Old Customizations - Recent Topics Blocks From Certain Forums
xmenfile [ Sat 08 Mar, 2008 04:37 ] Post subject: Recent Topics Blocks From Certain Forums
Hi,
I created a Recent Topics block and would like to have certain forums new recent topics. The Random Block has an option to pull from certain forum, but don't like it because they could be old topics.
Thank you,
xmenfile
KasLimon [ Sun 09 Mar, 2008 11:56 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Updated on 29th January 2009
What is this mod for?
This recent topic block extends the functionalities of the standard one without having to uninstall or modify the older one. The new functionalities are:
You are able to choose which forums to look for recent topics (by specifying ids separated by commas)
You can sort the topics alphabetically, or by date.
It's possible to group the topics by it's first letter
You can add up to five Recent Topic blocks per page (by default; it's explained below how to create more blocks)
If you don't understand something, the best way to see how it works is installing it.
Installation instructions
There's only one file modification. Please repeat it on every style you've installed.
Opentemplates/mg_styles/common.css At the very end of the file, add
Download the attached file (recent_topics_k1-5.zip)
Extract the file you've downloaded
Upload everything contained on ip_root folder to your forum root.
How to use Recent Topics K
The first thing you have to do is going into CMS management and then to the layout in which you wish to add the block(s). There, click Add block button and fill the form. In Block file, choose: recent topics k(1-5)*. Don't check Localize Titlebar, because the block's title doesn't have any language reference. Then Submit the form and you'll get a new form. Choose the options you like the most and submit the form. You will be able to see the new block on your cms page. Please repeat this procedure for each Recent Topic block you wish to add.
*(1-5) means any number between 1 and 5, and you are able to add more numbers by following the steps specified below. Please note: if you add two blocks with the same number in the same cms page, you'll get an awful error.
I need more recent topics blocks, what should I do?
The process is easy.
Go to /blocks/ dir and find this two files: blocks_imp_recent_topics_k1.php and blocks_imp_recent_topics_k1.cfg. Duplicate them and rename the copied files to blocks_imp_recent_topics_k6*.php and blocks_imp_recent_topics_k6*.cfg. Open both files using Notepad, WordPad, Dreamweaver, or any plain text editor you use, and use the Find&Replace function to replace all "k1" on the code (without inverted commas) for "k6"* (without inverted commas).
Then go to /templates/mg_styles/blocks/, duplicate the recent_topics_k1_block.tpl file located there and rename the copied file to recent_topics_k6*_block.tpl. Open the new file using Notepad, WordPad, Dreamweaver, or any plain text editor you use, and use the Find&Replace function to replace all "k1" on the code (without inverted commas) for "k6"* (without inverted commas). Repeat this step on every style you've installed.
*6 is the next number in the recent topic blocks list. If the last file you have is k5, this number must be 6; if the last file you have is k6, this number must be 7; and so on.
Older verision. Still works but not recommended (outdated).
array('Recent Topics Style', 'choose static display or scrolling display', 'md_recent_topics_style', 'Scroll,Static', '1,0', '3', 'recent_topics', '1'),
array('Recent Topics from certain forums', 'choose if recent topics will be only from a restricted ids', 'md_recent_topic_certain_forums', 'Yes,No', '1,0', '3', 'recent_topics', '0'),
array('Recent Topics IDs', 'Specify forum IDs to display recent topics', 'md_recent_topic_ids', '', '', '1', 'recent_topics', '')
You'll have to add block again and you'll see the options
ThE KuKa [ Sun 09 Mar, 2008 12:08 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Off Topic
:
KasLimon, again...
Rank for Kas: "Man of MOD"
Zuker [ Sun 09 Mar, 2008 16:33 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Moving to customizations
xmenfile [ Sun 09 Mar, 2008 17:48 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Thank you KasLimon, it works. But there are few issues, the forum id(s) save some where after you create a block.
1 let say i create block 1 and assign forum 1,2,3,4,5. if i change my mind delete forum 5 but add forum 6 (ex: 1,2,3,4,6), then my block still shows topics from forum 5 even it's not listed on my block configuration.
2 I delete the block 1 (above) that I create new block and assign 1,2,3,4,6 and my block still have forum 5 topics.
I have cleared site cache, that did not help. Any ideals??
Thank you so much,
KasLimon [ Mon 10 Mar, 2008 15:50 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Look at my block configuration:
Greets!
xmenfile [ Mon 10 Mar, 2008 17:33 ] Post subject: Re: Recent Topics Blocks From Certain Forums
yes, I did. that is the first box that i checked.
KasLimon [ Tue 11 Mar, 2008 09:53 ] Post subject: Re: Recent Topics Blocks From Certain Forums
It should be working OK, in my local forum it does...
Could you please send me a link to somewhere you've applied it?
Greetings!
xmenfile [ Tue 11 Mar, 2008 14:41 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Here you go, Check it out. I created 3 blocks, 1 for strolling recent from forum ID 4 ONLY, 1 block from forum ID 15 ONLY and the other recent wide block for all forums ('cause there is no option). somehow it mixed up each other and recent block shows twice.
Again, thank you so much for your help KasLimon,
KasLimon [ Tue 11 Mar, 2008 16:28 ] Post subject: Re: Recent Topics Blocks From Certain Forums
I think it's working well, but I see some blocks mixed and some strange things...
In this block it's not option, delete it and create it again, you'll see it
xmenfile [ Wed 12 Mar, 2008 06:52 ] Post subject: Re: Recent Topics Blocks From Certain Forums
well, it's not working. I deleted all recent blocks, cleared cache, then created 3 new ones. 1 recent topics block from forum 4, another recent topics block from forum 5 only, but some how the 1st block includes in this block too. Not yet, i created 1 recent topics wide block and this includes both of my first blocks. I double, triple check my edit and can't find any different than your instructions. I am going to post them here for another pairs of eyes, just in case.
/***************************************************************************
*
* 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');
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forums . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
$extra
$forum_ids
ORDER BY p.post_time DESC
LIMIT " . $cms_config_vars['md_num_recent_topics'][$block_id];
/***************************************************************************
*
* 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');
}
can anyone help me please. Some how they are still tangle each other. 1st recent block is ok , but if i create 2nd, 3rd... more, then they include my 1st block and spaces.
KasLimon [ Sat 15 Mar, 2008 15:56 ] Post subject: Re: Recent Topics Blocks From Certain Forums
I like my new rank
Can you show me the whole configuration you've set for each recent topics block, please?
Greets!
xmenfile [ Sat 15 Mar, 2008 18:11 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Here are my configurations, 1 for each forum
KasLimon [ Sat 15 Mar, 2008 21:23 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Ok I see the problem.
I'm not at home now, but when I arrive I'll fix it.
Greets!
xmenfile [ Sun 16 Mar, 2008 15:56 ] Post subject: Re: Recent Topics Blocks From Certain Forums
KasLimon, I can't wait
KasLimon [ Mon 17 Mar, 2008 23:54 ] Post subject: Re: Recent Topics Blocks From Certain Forums
I've been testing and I realised the problem is you have added more than one recent topics block.
The CMS is not prepared for that.
When you have 1 block is shown correctly
When you have 2 it is shown second block and first after it
That's because of the switches (<!-- BEGIN switch_mmm -->)
I don't think it would be easy to solve this.
In this moment I can't think on anything to solve it...
Sorry
xmenfile [ Tue 18 Mar, 2008 00:07 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Thank you so much Kaslimon for trying. So, it would be the same result if I tried to edit Recent Topics Wide right?
toniobr [ Mon 12 Jan, 2009 12:52 ] Post subject: Re: Recent Topics Blocks From Certain Forums
i have tried it and i have the same problem
KasLimon [ Thu 22 Jan, 2009 23:48 ] Post subject: Re: Recent Topics Blocks From Certain Forums
Yes, I know. I explained the reason some posts above (check here). I received a request some days ago and I'll recode this mod to make it work, I'll recode this for you to be able to create up to 5 different blocks.
Greets!
KasLimon [ Thu 29 Jan, 2009 00:05 ] Post subject: Re: Recent Topics Blocks From Certain Forums
It work very very God!!!! Thank You so much!!!!!!!
stunnah83 [ Fri 30 Jan, 2009 16:18 ] Post subject: Re: Recent Topics Blocks From Certain Forums
KasLimon thanks for the update. Better it works lol
OwnageWorld [ Wed 04 Mar, 2009 16:23 ] Post subject: Re: Recent Topics Blocks From Certain Forums
I'm getting an error with the newest version of IP (beta 2)
When adding a block I see the first screen and can fill everything in (name etc)
When I press submit, I can only see "Hacking attempt" and the left menu.
Someone knows how to fix this by any chance?
Thnx in advance!
New Player [ Wed 04 Mar, 2009 17:10 ] Post subject: Re: Recent Topics Blocks From Certain Forums
this mod is not for beta 2
all mods are incompatible with the newest version
OwnageWorld [ Fri 06 Mar, 2009 17:31 ] Post subject: [SOLVED] Recent Topics Blocks From Certain Forums
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id ' at line 3
SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username FROM ip_topics AS t, ip_posts AS p, ip_users AS u WHERE t.topic_id IN () AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id LIMIT 0
Line : 109
File : blocks_imp_recent_topics_k3.php
If you get this code, you can fix it by just simply posting topics to the forums. As I was using empty forums/ categories, I got this error all the time. Now it's fixed