Sub Menu
Links Menu
Online Users

In total there are 302 users online :: 3 registered, 0 hidden and 299 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot] based on users active over the past 60 minutes

Multiple Recent topics blocks

Support for the IM Portal Project

Moderator: Integra Moderator

Multiple Recent topics blocks

PostAuthor: Adrian Rea » Sun Aug 06, 2006 4:42 pm

I have searched around but cannot find this. I thought some have done it before. Is it possible to make several recent topic blocks and have them display the recent topics of specified forums?

A
Last edited by Adrian Rea on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 11:59 pm
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: Drop-Forged » Sun Aug 06, 2006 5:37 pm

I had something similar running between two separate sites, each site had its own recent topics and a recent topic block from the other site.

Worked good, except it confused some people, and had a little issue with sessions sometimes becuse the sitename was diferant.

Put that was 2 different boards,

Are you looking for multiple topic blocks on the same board???


That wuold be cool if we could just have it call on the forums we wanted them to.
Last edited by Drop-Forged on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://www.christiansoldiers.com/Sig/sig.png[/img][/url]
[url=http]Free IntegraMod 141 Themes at webhutch.net[/url]

Drop-Forged
Integra Member
Integra Member
 
Posts: 167
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 7:07 pm
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: billsatx » Sat Aug 12, 2006 6:06 am

Adrian..is this what you mean??

Goes in the phpBB2/blocks directory

blocks_imp_recent_topics2.cfg
Code: Select all
<?php/***************************************************************************  *                       blocks_imp_recent_topics.cfg  *                            -------------------  *   begin                ]http]  *   email                : [url=http://www.integramod.com]http://www.integramod.com[/url]  *   email                : <a>webmaster@integramod.com</a>  *  *   note: removing the original copyright is illegal even you have modified  *         the code.  Just append yours if you have modified it.  ***************************************************************************/  /***************************************************************************  *  *   This program is free software; you can redistribute it and/or modify  *   it under the terms of the GNU General Public License as published by  *   the Free Software Foundation; either version 2 of the License, or  *   (at your option) any later version.  *  ***************************************************************************/  if ( !defined('IN_PHPBB') ){         die("Hacking attempt");}  if(!function_exists(imp_recent_topics2_block_func)){         function imp_recent_topics2_block_func()         {                 global $template, $portal_config, $userdata, $board_config, $db, $phpEx, $var_cache, $lang;                   $forum_data = array();                 if($portal_config['cache_enabled'])                 {                         $forum_data = $var_cache->get('forum', 90000, 'forum');                 }                 if(!$forum_data)                 {                         $sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";                         if (!$result1 = $db->sql_query($sql))                         {                                 message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);                         }                         while( $row1 = $db->sql_fetchrow($result1) )                         {                                 $forum_data[] = $row1;                         }                         if($portal_config['cache_enabled'])                         {                                 $var_cache->save($forum_data, 'forum', 'forum');                         }                 }                   $is_auth_ary = array();                 $is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);                   if( $portal_config['md_except_forum_id2'] == '' )                 {                         $except_forum_id = ''start'';                 }                 else                 {                         $except_forum_id = $portal_config['md_except_forum_id2'];                 }                   for ($i = 0; $i <count>sql_query($sql))                 {                         message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);                 }                 $number_recent_topics = $db->sql_numrows($result1);                 $recent_topic_row = array();                 while ($row1 = $db->sql_fetchrow($result1))                 {                         $recent_topic_row[] = $row1;                 }                   if($portal_config['md_recent_topics_style2']){                         $style_row = 'scroll';                 }else                 {                         $style_row = 'static';                 }                   $template->assign_block_vars($style_row,"");                   for ($i = 0; $i <number_recent_topics>assign_block_vars($style_row . '.recent_topic_row', array(                                         'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],                                         'L_TITLE' => smilies_pass($recent_topic_row[$i]['topic_title']),                                         'L_BY' => $lang['By'],                                         'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),                                         'S_POSTER' => $recent_topic_row[$i]['username'],                                         'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])                                         )                                 );                         }                         else {                                 $template->assign_block_vars($style_row . '.recent_topic_row2', array(                                         'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],                                         'L_TITLE' => smilies_pass($recent_topic_row[$i]['topic_title']),                                         'L_BY' => $lang['By'],                                         'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),                                         'S_POSTER' => $recent_topic_row[$i]['post_username'],                                         'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])                                         )                                 );                         }                 }         }}  imp_recent_topics2_block_func();?>


Goes in the phpBB2/templates/yourtemplate/blocks/ directory
recent_topics2_block.tpl
Code: Select all
<table><tr><td><span><BEGIN><marquee><BEGIN>&raquo; <a><b>{scroll.recent_topic_row.L_TITLE}</b></a><br>by <a>{scroll.recent_topic_row.S_POSTER}</a> on {scroll.recent_topic_row.S_POSTTIME}<br><br><END></marquee><END><BEGIN><BEGIN>&raquo; <a><b>{static.recent_topic_row.L_TITLE}</b></a><br>by <a>{static.recent_topic_row.S_POSTER}</a> on {static.recent_topic_row.S_POSTTIME}<br><br><END><END></span></td></tr></table>


Then in the IM Portal config menu decide which forums for that recent topics. I have topics, topics2, topics3, topics4

Just redo above file and replace with the correct 2, 3, 4, 5 etc etc
Last edited by billsatx on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 8:38 am
Cash on hand: 0.00

PostAuthor: Adrian Rea » Sat Aug 12, 2006 6:44 am

Thanks Bill, That is exactly what I meant. [flash=,:2naniwiw]http://integramod.com/forum/images/icon/icon14.gif[/flash:2naniwiw]


A
Last edited by Adrian Rea on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 11:59 pm
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: billsatx » Sat Aug 12, 2006 7:05 am

Just FYI...sure you know, but for others who may not be as knowledgeable...it takes more than just renaming the files 2, 3, 4 etc. Within the files there are several references to recent_topics that must be renamed recent_topics2 and so forth.

If you compare the recent_topics and recent_topics2 it pretty easy to spot the changes.

Thus just make the next set of blocks recent_topics3 and so on.
Last edited by billsatx on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 8:38 am
Cash on hand: 0.00

PostAuthor: Adrian Rea » Sat Aug 12, 2006 7:08 am

Indeed, Nice follow up. <img>

A
Last edited by Adrian Rea on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 11:59 pm
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: billsatx » Sat Aug 12, 2006 8:17 am

Adrian...here is the link for the tutorial...

http://integramod.com/forum/kb.php?mode ... 2cab4cfbbe

I knew it was somewhere....
Last edited by billsatx on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 8:38 am
Cash on hand: 0.00

PostAuthor: Adrian Rea » Sat Aug 12, 2006 8:28 am

Well, it just goes to show that even I miss the odd item :D
Last edited by Adrian Rea on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 11:59 pm
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: evolver » Sat Aug 12, 2006 1:18 pm

"billsatx";p="13565" wrote:Within the files there are several references to recent_topics that must be renamed recent_topics2 and so forth.

If you compare the recent_topics and recent_topics2 it pretty easy to spot the changes.

Thus just make the next set of blocks recent_topics3 and so on.

There is more to change than you did...

Every instance of recent_topic_row has to be changed as well
If you don't, you won't be able to set the right amount of topics to display in a specific block...

And I guess the same has to be done for the scroll and static (style_row), and for the except_forum_id if you want it to be different on different blocks... <img>
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

Re: Multiple Recent topics blocks

PostAuthor: billsatx » Sat Aug 12, 2006 10:04 pm

Yes, as I said referenced comparing the two recent_topics vs recent_topics2. The attachements were originally so a person could compare. After I posted the tutorial, I figured better to read that than continue with eplaining.

The example posted works on several boards I have..

Thanks
Last edited by billsatx on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 8:38 am
Cash on hand: 0.00

Re: Multiple Recent topics blocks

PostAuthor: evolver » Mon Aug 14, 2006 4:09 pm

"billsatx";p="13596" wrote:Yes, as I said referenced comparing the two recent_topics vs recent_topics2. The attachements were originally so a person could compare. After I posted the tutorial, I figured better to read that than continue with eplaining.

The example posted works on several boards I have..

Thanks

Sorry billsatx, I'm not complaining...
I have to thank you for helping us on the right way...

I'm working on a fully automated solution for this...and I have figured out how...
I will create an .exe file for cloning the recent_topics_block files with the right filenames and replaced code...
The .exe file will only ask for a name (or number) and do the rest by itself...

I will post it soon... <img> (one of the next days)
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: Unregistered » Tue Aug 15, 2006 4:28 am

how abt a random picture block from a selected topic?
Last edited by Unregistered on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
J O N H | P L A Y E R

Unregistered
Sr Integra Member
Sr Integra Member
 
Posts: 254
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 07, 2006 1:51 pm
Cash on hand: 0.00

PostAuthor: evolver » Thu Aug 17, 2006 4:34 pm

"Unregistered";p="13697" wrote:how abt a random picture block from a selected topic?

I will try making more multiple blocks possible...

But for now, I have made a little tool to make it very easy with just a few mouseclicks to generate Recent_Topic_Blocks...

I hope you like it...

EDIT: I have it updated and uploaded:
Attachments
RecentTopicBlock_Generator.zip
Updated version
(271.51 KiB) Downloaded 713 times
Last edited by evolver on Mon Dec 11, 2006 10:08 am, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

Re: Multiple Recent topics blocks

PostAuthor: evolver » Sun Aug 20, 2006 10:43 pm

Could someone please check this out,
and place it in the downloadsection if it's OK?
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

Re: Multiple Recent topics blocks

PostAuthor: computerz » Fri Nov 17, 2006 12:57 am

"evolver";p="13879" wrote:Could someone please check this out,
and place it in the downloadsection if it's OK?


Could you draw up a text file explaining how to use it.
Last edited by computerz on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

computerz
Members
Members
 
Posts: 84
Likes: 0 post
Liked in: 0 post
Joined: Sun Aug 27, 2006 1:21 pm
Cash on hand: 0.00

Next

Return to IM Portal Support Forum

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]

cron