Jump to content


- - - - -

(V88)Custom Forum Blocks


  • Please log in to reply
137 replies to this topic

#41 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 02 August 2008 - 10:26 AM

well the same template bit handles both the latesttopics and latestposts. I want to skin the latestposts differently.

The block_row template bit handles both the latestposts and latesttopics

I have it modified it...but I want the latestposts blocks to have its own separate template bit as the information shown for it should actually hold the last_poster information rather than the thread starter info. Also it would be nice to modify the template bit to include a title tag to show the full name of the thread after the "...".

Also currently...the usergroup formatting is implemented for the latestposts[shows correctly for the latesttopics]. Can you fix that please.

Lemme try and explain with a screenshot:

Posted Image

For the latest topics...it shows fine..except for one glitch...here it shows the last poster information. Lemme prove it this way...the movie request thread was actually started by a member called "Cyberboy" and the last post was by "ahsanmani" but in the LatestTopic block the last poster name is shown instead of Thread Starter...this must actually be the case in LatestPosts actually where the last poster name is shown...but instead the thread starter name is shown...as in the current case "cyberboy".

Also for the usergroup formatting...in the latesttopics "PriThvik" is in the same group as "ahsanmani" but the same group member has a red colour in latesttopics...but in the latestposts...there is no usergroup formatting that is followed.

I hope you now understood what I am trying to convey. Lemme know if you have understood...if not I shall try to make a video this time.
&nbsp;<a href="{$this->ipsclass->base_url}showtopic={$row['tid']}&view=getnewpost"><b><i>{$row['title']}</i></b></a>
{$row['lang_by']} {$row['starter']}
<br /><br />

The above one is my block_row template [its the same case even with the default template bit]

Edited by lsat1212, 02 August 2008 - 10:49 AM.


#42 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 02 August 2008 - 11:43 AM

Ok to make the latest posts block show the latest member posted and make there name formatted with the groups prefix and suffix:

Open sources/lib/func_customblocks.php

find in function latest_posts

find:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=p.author_id",
		'type'   => 'left'
		),
		1 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		)
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

replace with:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		),
			1 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=t.last_poster_id",
		'type'   => 'left'
		),
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

find:


$row['starter'] = $this->ipsclass->make_profile_link($row['starter_name'], $row['starter_id']);


replace with:

$row['starter'] = $this->ipsclass->make_profile_link( $this->ipsclass->make_name_formatted($row['last_poster_name'], $row['mgroup']), $row['last_poster_id'] );

save and upload.

This is untested but should work.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#43 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 02 August 2008 - 03:49 PM

There is something wrong with the latest post logic...can you recheck it please? The member group formatting is fixed though. Also while checking it with the default template, the last post date is not tallying with the actual last post date..this happens only with latestpost block. Its fine with latesttopic block. Also would like to know how are the latestposts ordered ?

Posted Image

Do you notice it? The order that is shown is Today, 20th july, yesterday....?

Edited by lsat1212, 02 August 2008 - 04:06 PM.


#44 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 02 August 2008 - 05:14 PM

open the same file find:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		),
			1 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=t.last_poster_id",
		'type'   => 'left'
		),
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

replace with:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		),
			1 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=t.last_poster_id",
		'type'   => 'left'
		),
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 't.last_post DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#45 Guest_Adelard_*

Guest_Adelard_*
  • Guests

Posted 02 August 2008 - 05:26 PM

Yeah, I have same problem but i through that's because of difference in time system. Vadim, code above don't work ;)

#46 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 02 August 2008 - 05:47 PM

What do you mean by dont work?
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#47 Guest_Adelard_*

Guest_Adelard_*
  • Guests

Posted 02 August 2008 - 05:56 PM

Posted Image

Edited by Adelard, 02 August 2008 - 05:56 PM.


#48 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 03 August 2008 - 08:01 AM

I get the similar output as that of Adelard...not fixed.

#49 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 03 August 2008 - 08:18 AM

Then find this:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		),
			1 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=t.last_poster_id",
		'type'   => 'left'
		),
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 't.last_post DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

replace with:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		),
			1 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=t.last_poster_id",
		'type'   => 'left'
		),
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

This is done "in the dark" since i can't test it right now so if that does not work you will have to wait till i can get this tested and fixed.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#50 Guest_Adelard_*

Guest_Adelard_*
  • Guests

Posted 03 August 2008 - 12:30 PM

Unpleasantly to notice but thing above it's not working. No need for hastiness, I will gladly wait ;)

#51 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 03 August 2008 - 03:16 PM

@Vadim..mate..take your time and post a tested and fixed version.

#52 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 04 August 2008 - 10:18 AM

OK, Here is a fix for that problem i tested it and it worked for me.

Open sources/lib/func_customblocks.php

find in function latest_posts

find:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=p.author_id",
		'type'   => 'left'
		),
		1 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		)
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

replace with:

$this->ipsclass->DB->simple_construct(
		array(
		'select'   => "p.*",
		'from'	 => array('posts' => 'p'),
		'add_join' => array(
		0 => array(
		'select' => 'm.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.members_display_name',
		'from'   => array( 'members' => 'm' ),
		'where'  => "m.id=p.author_id",
		'type'   => 'left'
		),
		1 => array(
		'select' => 't.*',
		'from'   => array( 'topics' => 't' ),
		'where'  => "t.tid=p.topic_id",
		'type'   => 'left'
		)
		),
		'where' => 't.forum_id IN(' .  implode( ',', $forum_ids ). ') AND t.approved=1 AND p.queued=0',
		'order'	=> 'p.post_date DESC',
		'limit'	=> array( 0, $last_x ),
		)
		);

find:


$row['starter'] = $this->ipsclass->make_profile_link($row['starter_name'], $row['starter_id']);
				$row['start_date']  = $this->ipsclass->get_date( $row['start_date'], 'TINY' );
				$row['date_array'] = $this->ipsclass->date_getgmdate( $row['post_date'] + $this->ipsclass->get_time_offset() );


replace with:

$row['starter'] = $this->ipsclass->make_profile_link( $this->ipsclass->make_name_formatted($row['members_display_name'], $row['mgroup']), $row['id'] );
				$row['start_date']  = $this->ipsclass->get_date( $row['start_date'], 'TINY' );
				$row['date_array'] = $this->ipsclass->get_date( $row['post_date'], 'LONG' );

save and upload.

let me know what happens for you guys.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#53 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 04 August 2008 - 05:51 PM

ok the latest posts works fine..but for the latest topics...it should actually should show the thread starter information rather than the last poster information..also the time for the latest topic is shown from the last post. It should actually show when the exact time at which it was created.

#54 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 04 August 2008 - 07:21 PM

well that's basically based on each member , Some wanted it this way so i did it like this. Changing it will not be a problem but it wont be added the the default modification installation.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#55 Guest_Adelard_*

Guest_Adelard_*
  • Guests

Posted 04 August 2008 - 09:57 PM

lsat1212, you are lucky man :) thats history of my latestpost:
Attached File  cleanlatestpost.JPG   41.32K   0 downloads
1. With clean func_customblocks.php
Attached File  with_fix.JPG   40.36K   0 downloads
2. With fix from this post.
Attached File  fix_nr2.JPG   39.33K   0 downloads
3. With fix from this post.

Notice: Description is below pictures ;)

Edited by Adelard, 04 August 2008 - 10:04 PM.


#56 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 05 August 2008 - 06:08 AM

I can't understand any of that. Does that color the user names right? About the time thing i think we have discussed this and you did some edits to work differently then the default IPB way of doing this. Since i can't test it i can't really help you with the time thing. I know Dwapi has a support forum in Swedish i think and i think you will have more luck fixing that problem in those forums. I am sorry this is just beyond my scope of support, This mod was sold over 30 times and i had no issues reported about this.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#57 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 05 August 2008 - 08:12 AM

@Vadim...thanx for the support mate..yes, I would like the fucttionality that I have described for the latesttopics.

@Adelard...mate...why dont you PM your func_customblocks to vadim so that he can check it out for you?

#58 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 05 August 2008 - 08:46 AM

That won't change a lot, I know that he did some changes to the time formatting functions that for some reason the edits have no effect on him.

To change that you requested about the latest topics find in the func_customblocks.php file in the function last_topics()

find:

'where'  => 'm.id=t.last_poster_id',

replace with:

'where'  => 'm.id=t.starter_id 	',


find:

$row['start_date']  = $this->ipsclass->get_date( $row['start_date'], 'SHORT' );
$row['date_array'] = $this->ipsclass->date_getgmdate( $row['post_date'] + $this->ipsclass->get_time_offset() );

replace with:

$row['start_date']  = $this->ipsclass->get_date( $row['start_date'], 'TINY' );
$row['date_array'] = $this->ipsclass->get_date( $row['start_date'], 'LONG' );


save and upload.

That should do it.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#59 sourabh

sourabh

    Advanced Member

  • Members
  • PipPipPipPip
  • 52 posts
  • IPB Version:v2.3.x

Posted 05 August 2008 - 09:52 AM

excellent...thank you! Also as a suggestion...when you are truncating the thread title...why not include full title in the "title" tag?

#60 Dekuwa

Dekuwa

    n00b

  • Members
  • Pip
  • 1 posts
  • Real Name:Dekuwa
  • IPB Version:v3.0.x

Posted 22 August 2008 - 11:12 AM

Payment send.. waiting mod ;)

Thx!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users