Log in

View Full Version : Administrative and Maintenance Tools - Hot Topics/Threads


tnguy3n
04-10-2005, 10:00 PM
Author: tnguy3n (Thinh Nguyen)
Support Site: http://www.all4a-designs.com
Live Demo: http://www.all4actions.net/forums/toptopics.php (click on the link to see demo on my site)

Description:
This hacks show hot threads/topics on one page. Admins have ability to enable/disable guest access, select which blocks display on the page.

New settings: 7
Template Mods: 4 new templates
File Mods: 0
New File: 1

Requested by Aceman here (https://vborg.vbsupport.ru/showthread.php?t=78751)

tnguy3n
04-11-2005, 05:23 AM
Oops sorry, post in wrong forum. Can mods pls move this hack to appropriate forum? thanks.

Allan
04-11-2005, 11:39 AM
and one moreover, cheer have you, I very well also find it, good job :)

-=Sniper=-
04-11-2005, 12:38 PM
nice and simple hack :) will use it.

JoeLouie
04-11-2005, 03:34 PM
I followed the instructions, but it doesn't seem to work. Who I go to toptopics.php is says:

JoeLouie, you do not have permission to access this page. This could be due to one of several reasons:

1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

If I go to the settings all I see is "Top Topics Settings" with the save and reset button... no actual settings. I've looked through the instructions a few times and can't see what I missed. Any help?

tnguy3n
04-11-2005, 04:11 PM
that's weird. what version of vb you'r running?

JoeLouie
04-11-2005, 04:17 PM
sorry, shoulda mentioned that. I'm running 3.0.7.

I must have looked over the instructions 20 times by now and can't find any steps that I missed.

tnguy3n
04-11-2005, 04:33 PM
sorry, shoulda mentioned that. I'm running 3.0.7.

I must have looked over the instructions 20 times by now and can't find any steps that I missed.
It must be the queries in setting table that messes this hack up. Can you browse your vb setting table in phpMyAdmin, then post (or PM) settings of this hacks? It should be last 7 settings.

Lionel
04-11-2005, 04:41 PM
This is displaying the threads double here (http://www.haitiwebs.com/haitianforums/toptopics.php)

JoeLouie
04-11-2005, 04:46 PM
It must be the queries in setting table that messes this hack up. Can you browse your vb setting table in phpMyAdmin, then post (or PM) settings of this hacks? It should be last 7 settings.

How's this?

xtreme-mobile
04-11-2005, 04:47 PM
im getting the same as JoeLouie but on vb 3.06

any ideas?

JoeLouie
04-11-2005, 04:56 PM
just figured it out... in the grouptitle field you have the value in there... fixing it now.

xtreme-mobile
04-11-2005, 05:03 PM
? whats up with it mate?

how can i fix mine also mate can you give me the instructions lol

cheers mate

JoeLouie
04-11-2005, 05:09 PM
yep, just give me a few minutes, gotta test it to make sure I fixed it right :)

EDIT: Check the 2nd page, I posted the fix there. Some people seem to have gotten it working without the fix, but I'm running 3.0.7 and it wouldn't work without it.

tnguy3n
04-11-2005, 05:10 PM
Settings seems right. I doubt if settinggroup got anything do with that error thou.
I'll write installers for next time to prevent these problems.

@Lionel: I can't figure out at the moment why it print a thread twice. I may use SELECT DISTINCT in next release if it fix that problem. btw, it may help to track the bug if you could provide version of vb you'r running.

xtreme-mobile
04-11-2005, 05:12 PM
if i cant get this to work, how do you remove the queries??? im new to all this

JoeLouie
04-11-2005, 05:13 PM
The instructions said to do this:
INSERT INTO `setting` VALUES ('toptopics_limit', '5', '', 7, 'toptopics', '5', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', '120', '', 5, 'toptopics', '150', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', '1', 'yesno', 4, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', '1', 'yesno', 3, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', '1', 'yesno', 2, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', '1', 'yesno', 1, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', '160', '', 6, 'toptopics', '150', 0, 0);

but it should be this*:
INSERT INTO `setting` VALUES ('toptopics_limit', 'toptopics', '5', '5', '', 7, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', 'toptopics', '120', '120', '', 5, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', 'toptopics', '1', '1', 'yesno', 4, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', 'toptopics', '1', '1', 'yesno', 2, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', 'toptopics', '1', '1', 'yesno', 3, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', 'toptopics', '1', '1', 'yesno', 1, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', 'toptopics', '160', '160', '', 6, 0, 0);

* That's what I had to change to get this working on my board running vB 3.0.7 (http://board.optical-edge.net/toptopics.php)

Lionel
04-11-2005, 05:13 PM
sorry 3.07

tnguy3n
04-11-2005, 05:18 PM
The instructions said to do this:
INSERT INTO `setting` VALUES ('toptopics_limit', '5', '', 7, 'toptopics', '5', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', '120', '', 5, 'toptopics', '150', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', '1', 'yesno', 4, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', '1', 'yesno', 3, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', '1', 'yesno', 2, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', '1', 'yesno', 1, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', '160', '', 6, 'toptopics', '150', 0, 0);

but it should be this:
INSERT INTO `setting` VALUES ('toptopics_limit', 'toptopics', '5', '5', '', 7, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', 'toptopics', '120', '120', '', 5, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', 'toptopics', '1', '1', 'yesno', 4, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', 'toptopics', '1', '1', 'yesno', 2, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', 'toptopics', '1', '1', 'yesno', 3, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', 'toptopics', '1', '1', 'yesno', 1, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', 'toptopics', '160', '160', '', 6, 0, 0);
Interesting! I wrote this hack on dev board (3.0.7) on my PC, then installed it on v.3.0.5, I got that same problem as you guys described and I had to manually change those values. I doubt if the structure of vb setting table got changed since version 3.0.5.

Lionel
04-11-2005, 05:19 PM
Mine are correct. Best to do is insert into settings('varname',...) values(....

Lionel
04-11-2005, 09:37 PM
Any ideas yet about the double threads display?

tnguy3n
04-11-2005, 10:49 PM
:confused: Did you make any change in the script? You alter vote to totalvote?

Lionel
04-11-2005, 10:54 PM
none whatsoever. not in templates not in file. straight from downloading to my server.

dede1
04-12-2005, 04:57 AM
Hello

I get only a white side, look:
http://www.dede1.mine.nu/Board/toptopics.php

pjdaley
04-12-2005, 05:09 AM
Hello

I get only a white side, look:
http://www.dede1.mine.nu/Board/toptopics.php

check your templates, make sure you did them right.

DR?@M W?@V?R
04-12-2005, 07:26 AM
nice mod, thanks for the database update. I noticed that there was 4 uncached templates, under.

$specialtemplates = array();

I put.

$globaltemplates = array(
'TOPTOPICS',
'toptopics_highvote',
'toptopics_mostreplies',
'toptopics_mostviews');

And I had to require the back-end after this or it would not pre-cache.

// #################### DEFINE IMPORTANT CONSTANTS #######################
//define('NO_REGISTER_GLOBALS', 1);
//define('THIS_SCRIPT', 'toptopics');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

$globaltemplates = array(
'TOPTOPICS',
'toptopics_highvote',
'toptopics_mostreplies',
'toptopics_mostviews');

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

DR?@M W?@V?R
04-12-2005, 08:09 AM
how would you apply permissions to view topics, as 2 threads I have are in the admin forum and I dont want guest to view them.

http://www.majesticforum.com/forum/toptopics.php

dede1
04-13-2005, 03:38 AM
If guests the side see comes may only the white side may guests you do not see comes no rights.

Where is the mistake there?

Nordinho
04-19-2005, 10:54 PM
this looks very nice...one question though...would it be possible to display the top threads from specific forums??

vakvak
04-21-2005, 01:30 PM
thank...

But problem

Problem vbulletin options/top topics setting

settings not
Upload toptopics.php to your /forum home :::::::: ok
Sql ::::::: ok
4 new template :::::::: ok

but view not: help pls

https://vborg.vbsupport.ru/external/2005/05/16.jpg

vakvak
04-21-2005, 02:14 PM
but it should be this*:
INSERT INTO `setting` VALUES ('toptopics_limit', 'toptopics', '5', '5', '', 7, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', 'toptopics', '120', '120', '', 5, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', 'toptopics', '1', '1', 'yesno', 4, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', 'toptopics', '1', '1', 'yesno', 2, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', 'toptopics', '1', '1', 'yesno', 3, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', 'toptopics', '1', '1', 'yesno', 1, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', 'toptopics', '160', '160', '', 6, 0, 0);

* That's what I had to change to get this working on my board running vB 3.0.7 (http://board.optical-edge.net/toptopics.php)

thank you my friend yes should be this

deb0
04-23-2005, 03:25 PM
I'm getting this error after following the instructions:

Database error in vBulletin 3.0.6:

Invalid SQL: SELECT thread.threadid, thread.title AS threadtitle, thread.lastpost, thread.forumid, thread.open, thread.replycount, thread.postusername, thread.postuserid, thread.lastposter, thread.dateline, thread.visible, forum.forumid, forum.title AS forumtitle, user.username, user.userid AS lastposterid
FROM thread
LEFT JOIN forum AS forum ON(forum.forumid = thread.forumid)
LEFT JOIN user AS user ON(user.username = thread.lastposter)
WHERE thread.open = 1
AND thread.visible = 1
ORDER BY thread.replycount DESC
LIMIT 0,

mysql error: 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 '' at line 8

mysql error number: 1064

kthlnwrnr
04-26-2005, 07:28 AM
How do I place a link to the toptopic section from the forum home?

deb0
04-26-2005, 10:21 AM
This is an awesome hack. I just have one biggy request that's missing: Is it possible to include a setting that allows you to exclude/include forums?

I want it to only list the 'non-entertainment' forums in my site.

Allan
05-12-2005, 09:54 PM
thank...

But problem

Problem vbulletin options/top topics setting

settings not
Upload toptopics.php to your /forum home :::::::: ok
Sql ::::::: ok
4 new template :::::::: ok

but view not: help pls

http://img34.echo.cx/img34/5392/tp7yk.jpg

I have the same thing, an idea please ? :(

Allan
05-12-2005, 10:59 PM
The instructions said to do this:
INSERT INTO `setting` VALUES ('toptopics_limit', '5', '', 7, 'toptopics', '5', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', '120', '', 5, 'toptopics', '150', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', '1', 'yesno', 4, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', '1', 'yesno', 3, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', '1', 'yesno', 2, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', '1', 'yesno', 1, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', '160', '', 6, 'toptopics', '150', 0, 0);

but it should be this*:
INSERT INTO `setting` VALUES ('toptopics_limit', 'toptopics', '5', '5', '', 7, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', 'toptopics', '120', '120', '', 5, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', 'toptopics', '1', '1', 'yesno', 4, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', 'toptopics', '1', '1', 'yesno', 2, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', 'toptopics', '1', '1', 'yesno', 3, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', 'toptopics', '1', '1', 'yesno', 1, 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', 'toptopics', '160', '160', '', 6, 0, 0);

* That's what I had to change to get this working on my board running vB 3.0.7 (http://board.optical-edge.net/toptopics.php)

Ok, I had not seen this part

@tnguy3n: You should modify your file to attach ;)

Thank you for the second time (post #3) for your hack.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Click install
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Acers
05-14-2005, 06:52 AM
grt hack
/me click install

Acers
05-14-2005, 08:18 AM
hey guys... i just found that this is taking all threads from all the forums.
So to protect the private forums..i did this
in the toptopics.php below line
// ######################## START MAIN SCRIPT ############################

added below

$excludedforums = "48,34"; // forums to be excluded from latest threads. Format "0,1,2,3"

i have taken 48,34 as an example. these are the forum ids btw

then in same file find

WHERE thread.open = 1
AND thread.visible = 1

and add below

AND thread.forumid NOT IN ($excludedforums)

did this for all three occurences in that page.

Now forums are safe from all private forum posts showing there.
Btw same can be extended to whatever forums you wanna hide. say if you just want this to work for one forum exclude all the rest forums.

deb0
05-14-2005, 01:10 PM
@Acers, U R Da Man! Works flawlessly. thx.

Acers
05-14-2005, 02:18 PM
glad to be of help mate :)

organik81
05-18-2005, 11:50 AM
I have the same problem too; in #35'th post...

lefthome
09-28-2005, 04:09 PM
INSERT INTO `setting` VALUES ('toptopics_limit', '5', '', 7, 'toptopics', '5', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_titlecut', '120', '', 5, 'toptopics', '150', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_highvote', '1', 'yesno', 4, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostreplies', '1', 'yesno', 3, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_mostviews', '1', 'yesno', 2, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_noguest', '1', 'yesno', 1, 'toptopics', '1', 0, 0);
INSERT INTO `setting` VALUES ('toptopics_forumcut', '160', '', 6, 'toptopics', '150', 0, 0);


Installed the hack and found out these were wrong. Can somebody tell me how to remove these so I install the correct ones?

lairnoc
10-23-2005, 01:06 PM
will there be a port to 3.5 ?? i really love this hack..

tnguy3n
10-25-2005, 12:50 AM
will be released later of the day. ;)