View Full Version : Mini Mods - Lucky Thread
Atakan KOC
10-27-2008, 10:00 PM
Lucky Thread
This hack redirects the user to a various thread when they click "Lucky" button on the navbar. This is like Google's lucky button. Let's see what is your lucky subject. install
Go to your admin cp, then:
Plugin System -> Manage Products -> [Add/Import Product] -> Select 'product-lucky.xml' from your computer then press 'Import'
Modifications Info
Plugin : 3
Phrases : 1
Template : 1
Setting : 0
Versions:
v1.0 - 22 Octaber 2007
-First release
v1.1 - 28 Octaber 2007
- Query error fixed
- Setting Added
- Usergroup permisson added
- Disallow forum ID added
- Forum permisson added
- On/Off added
v1.2 - 20 December 2007
- vBulletin 3.7
- Project name change "Lucky Button => Lucky Thread"
- Small Phrase change
v2.0 - 12 Octaber 2008
Atakan KOC
10-28-2008, 04:44 PM
Reserved.
bleros
10-29-2008, 12:18 AM
nice job mann
joey.cn
10-29-2008, 02:46 AM
if (is_array($settings['lucky_group']))
{
$settings['lucky_group'] = implode(',', $settings['lucky_group']);
}
parreira
11-12-2008, 08:50 PM
bu nedir abi ben anlamadim ?
parreira
11-12-2008, 08:51 PM
he tamam almancaya cevirtttirdim google amcaya:
Dieser Hack leitet den Benutzer auf einen einzelnen Thread, wenn sie klicken Sie auf "Lucky"-Taste auf der navbar. Das ist wie Google-Glück-Taste. Mal sehen, was ist Ihr Glück Thema
Magnumutz
11-13-2008, 07:46 AM
English guys, this is an English forum.
albibak
11-20-2008, 03:32 PM
Thanks for this mod Atakan.
I have a problem, when I go to the AdminCP, it never let the check for the usergroup.
shooter83
11-25-2008, 06:10 AM
Thanks for this mod Atakan.
I have a problem, when I go to the AdminCP, it never let the check for the usergroup.
i'm having the same problem. this hack works great until you make a change to the options. and then the the lucky thread link takes you to the smiles page every time because you cannot save the usergroups:(
vip_inc200
11-25-2008, 10:39 AM
thanks for this mod
Nadeemjp
01-15-2009, 06:30 AM
interesting indeed:)
fragov
01-16-2009, 04:21 PM
Database error in vBulletin 3.8.0:
Invalid SQL:
SELECT threadid, dateline, visible FROM vb_thread WHERE NOT ISNULL(threadid) AND visible = '1' AND thread.forumid NOT IN (0) ORDER BY RAND() LIMIT 1;
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Request Date : Friday, January 16th 2009 @ 08:19:20 PM
Error Date : Friday, January 16th 2009 @ 08:19:20 PM
Script : http://www.poltavaforum.com/misc.php?do=lucky
Referrer :
Classname : vB_Database
MySQL Version : 5.1.23-rc
icemann
01-18-2009, 02:54 PM
Will not save selected usergroups, it unchecks them all......using vBulletin v3.8 :(
chickadee
01-28-2009, 07:21 AM
i'm having the same problem. this hack works great until you make a change to the options. and then the the lucky thread link takes you to the smiles page every time because you cannot save the usergroups:(
I'm having the same problem. Has anyone figured this out?
Chadi
01-30-2009, 03:04 AM
Same problem, was never even fixed in 3.7 either. Takes you to smiley page for some reason. Please fix, its a great mod.
Brandon Sheley
01-30-2009, 03:48 AM
ah, fun hack man :)
edytwinky
06-11-2009, 04:23 PM
So is this working now?
Can you select which forums it doesn't go to?
DobieGillis?
06-11-2009, 04:25 PM
So is this working now?
Can you select which forums it doesn't go to?
I tried it, did not work.
edytwinky
06-11-2009, 04:29 PM
Yeah i installed it and it won't save the usergroups i select for it to work with
DobieGillis?
06-11-2009, 04:56 PM
Yeah i installed it and it won't save the usergroups i select for it to work with
that's the issue.
RTMdotORG
06-11-2009, 06:06 PM
Working On Trying To Fix This For The Author...
As Was Said That The Same Error Was In 3.7...
The Best I Could Do So Far Was Make It Active For ALL Usergroups...
Here is The XML....
DobieGillis?
06-11-2009, 06:17 PM
Working On Trying To Fix This For The Author...
As Was Said That The Same Error Was In 3.7...
The Best I Could Do So Far Was Make It Active For ALL Usergroups...
Here is The XML....
nice!
DobieGillis?
06-11-2009, 06:21 PM
got it installed, just can't find a link to it. Is it a manual edit?
RTMdotORG
06-11-2009, 06:45 PM
Ok, this looks like the only way to get this to work....
download and install the plugin provided....
the default usergroups.. are 2,5,6,7...
if you want different usergroups, you're going to have to edit the product....
go to edit templates>>>navbar>>
Find:
vbphrase[faq]</a></td>
Add After:
<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>
Open the Product
Find:
<defaultvalue>2,5,6,7</defaultvalue>
Change the usergroup id to your liking...
DO NOT CHANGE ANY SETTINGS FOR THIS MOD IN THE VBULLETIN OPTIONS, OR IT WILL RESET USERGROUPS...
DobieGillis?
06-11-2009, 06:48 PM
Ok, this looks like the only way to get this to work....
download and install the plugin provided....
the default usergroups.. are 2,5,6,7...
if you want different usergroups, you're going to have to edit the product....
go to edit templates>>>navbar>>
Find:
vbphrase[faq]</a></td>
Add After:
<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>
Open the Product
Find:
<defaultvalue>2,5,6,7</defaultvalue>
Change the usergroup id to your liking...
DO NOT CHANGE ANY SETTINGS FOR THIS MOD IN THE VBULLETIN OPTIONS, OR IT WILL RESET USERGROUPS...
thanks mate!
Jamieinnh
06-11-2009, 06:54 PM
Thanks for a great Mod and Thanks for the ones that help fix it to work with all the user groups!
Jamie
edytwinky
06-12-2009, 08:46 AM
Still couldn't get this sucker to work. Crap
edytwinky
06-12-2009, 08:04 PM
If I could get any help on this, it'd be greatly appreciated. I'm running vb 3.8.2.
Is there some LUCKY button that is supposed to pop up?
I'd like for this to work with usergroups: 6, 28, 29 and 32
I'd like for it to not use the forum ids: 9, 10, 12, 16, 17, 18, 22, 25, 29, 30, 32, 34, 37, 39, 43, 46, 55
RTMdotORG
06-12-2009, 09:58 PM
If I could get any help on this, it'd be greatly appreciated. I'm running vb 3.8.2.
Is there some LUCKY button that is supposed to pop up?
I'd like for this to work with usergroups: 6, 28, 29 and 32
I'd like for it to not use the forum ids: 9, 10, 12, 16, 17, 18, 22, 25, 29, 30, 32, 34, 37, 39, 43, 46, 55
try this....
go to edit templates>>>navbar>>
Find:
vbphrase[faq]</a></td>
Add After:
<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>
and upload this xml, BUT DONT SUBMIT ANY SETTINGS IN THE VBULLETIN OPTIONS..THE XML I PROVIDED SHOULD WORK THE WAY YOU WANT IT TO :D
edytwinky
06-12-2009, 10:31 PM
Thanks. I tried it and received this error:
Database error in vBulletin 3.8.2:
Invalid SQL:
SELECT threadid, dateline, visible FROM xxxcthread WHERE NOT ISNULL(threadid) AND visible = '1' AND thread.forumid NOT IN (0,17,18,29,30) ORDER BY RAND() LIMIT 1;
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Request Date : Friday, June 12th 2009 @ 07:30:03 PM
Error Date : Friday, June 12th 2009 @ 07:30:03 PM
Script : http://forums.xxx.com/misc.php?do=lucky
Referrer : http://forums.xxx.com/index.php
IP Address : 68.102.23.100
Username : xxx
Classname : vB_Database
MySQL Version : 5.0.77-community
RTMdotORG
06-12-2009, 10:33 PM
im working on fixing this....
RTMdotORG
06-12-2009, 10:44 PM
Ive Fixed It!!!
Upload New XML Here!!!
go to edit templates>>>navbar>>
Find:
vbphrase[faq]</a></td>
Add After:
<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>
Working on adding auto templates...
edytwinky
06-13-2009, 01:00 AM
I tried again and had the error:
Database error in vBulletin 3.8.2:
Invalid SQL:
SELECT threadid, dateline, visible FROM xxxthread WHERE NOT ISNULL(threadid) AND visible = '1' AND thread.forumid NOT IN (9,10,12,16,17,18,22,25,29,30,32,34,37,39,43,46,55 ,17,18,29,30) ORDER BY RAND() LIMIT 1;
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Request Date : Friday, June 12th 2009 @ 09:59:38 PM
Error Date : Friday, June 12th 2009 @ 09:59:38 PM
Script : http://forums.xxx.com/misc.php?do=lucky
Referrer :
IP Address : 68.102.23.100
Username : xxx
Classname : vB_Database
MySQL Version : 5.0.77-community
In the new xml file I edited it to add my forumid and usergroupid numbers:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="lucky" active="1">
<title>Lucky Thread</title>
<description>http://www.tvpano.com/</description>
<version>2.0.0</version>
<url>http://www.tvpano.com/</url>
<versioncheckurl />
<apm_releasedate>1223787600</apm_releasedate>
<apm_author>H.Atakan KOC</apm_author>
<apm_relatedurl />
<apm_extrainfo>http://www.tvpano.com/</apm_extrainfo>
<apm_extraedit />
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
<template name="lucky" templatetype="template" date="1223831611" username="admin" version=""><![CDATA[<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>]]></template>
</templates>
<plugins>
<plugin active="1" executionorder="5">
<title>Lucky</title>
<hookname>admin_options_processing</hookname>
<phpcode><![CDATA[if (is_array($vbulletin->GPC['setting']['lucky_group']))
{
$vbulletin->GPC['setting']['lucky_group'] = implode(',', $vbulletin->GPC['setting']['lucky_group']);
}]]></phpcode>
</plugin>
<plugin active="1" executionorder="5">
<title>luck</title>
<hookname>cache_templates</hookname>
<phpcode><![CDATA[$globaltemplates[] = 'lucky';]]></phpcode>
</plugin>
<plugin active="1" executionorder="5">
<title>lucky</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[if ($vbulletin->options['lucky_onoff'])
{
$wol_can_view = is_member_of($vbulletin->userinfo,explode(',',$vbulletin->options['lucky_group'])) ? true : false;
if ($wol_can_view)
{
$search_text = "vbphrase[faq]</a></td>";
$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.fetch_templa te('lucky'),$vbulletin->templatecache['navbar']);
}
}]]></phpcode>
</plugin>
<plugin active="1" executionorder="5">
<title>Lucky</title>
<hookname>misc_start</hookname>
<phpcode><![CDATA[if ($_REQUEST['do'] == 'lucky')
{
if ($vbulletin->options['lucky_onoff'])
{
$wol_can_view = is_member_of($vbulletin->userinfo,explode(',',$vbulletin->options['lucky_group'])) ? true : false;
if ($wol_can_view)
{
$excludedforums = '';
if ($vbulletin->options['lucky_forum'] !== '') {
$excludedforums = ',' . $vbulletin->options['lucky_forum'];
}
$forumpermissions = array();
foreach($vbulletin->forumcache AS $forum) {
$forumpermissions[$forum["forumid"]] = fetch_permissions($forum['forumid']);
if (!($forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
$excludedforums = $excludedforums . ',' . $forum['forumid'];
}
}
unset($forum);
// get rid of initial comma
$excludedforums = substr($excludedforums, 1);
if ($excludedforums != "9,10,12,16,17,18,22,25,29,30,32,34,37,39,43,46,55") {
$excludedforums = "AND thread.forumid NOT IN ($excludedforums)";
}
$lucky_threads = $db->query_first("SELECT threadid, dateline, visible FROM " . TABLE_PREFIX . "thread WHERE NOT ISNULL(threadid) AND visible = '1' $excludedforums ORDER BY RAND() LIMIT 1");
header('Location: showthread.php?t='.$lucky_threads['threadid']);
}
}
}]]></phpcode>
</plugin>
<plugin active="1">
<title>save our multiselect values</title>
<hookname>admin_options_processing</hookname>
<phpcode><![CDATA[
if (preg_match ('/checkbox/i', $oldsetting['optioncode']))
{
if (is_array ($settings["$oldsetting[varname]"])) $settings["$oldsetting[varname]"] = implode (',', $settings["$oldsetting[varname]"]);
}]]></phpcode>
</plugin>
</plugins>
<phrases>
<phrasetype name="GLOBAL" fieldname="global">
<phrase name="lucky" date="1198165457" username="Administrator" version=""><![CDATA[Lucky Thread]]></phrase>
</phrasetype>
<phrasetype name="vBulletin Settings" fieldname="vbsettings">
<phrase name="setting_lucky_forum_desc" date="1198165624" username="Administrator" version="1.2.0"><![CDATA[Sparate Forum ID by Comma]]></phrase>
<phrase name="setting_lucky_forum_title" date="1198165624" username="Administrator" version="1.2.0"><![CDATA[Disallow Forum ID]]></phrase>
<phrase name="setting_lucky_group_desc" date="1198165624" username="Administrator" version="1.2.0"><![CDATA[Select The Usergroups]]></phrase>
<phrase name="setting_lucky_group_title" date="1198165624" username="Administrator" version="1.2.0"><![CDATA[Display UserGroup IDs]]></phrase>
<phrase name="setting_lucky_onoff_desc" date="1198165646" username="Administrator" version="1.2.0"><![CDATA[This setting allows you to enable/disable the Lucky Thread.]]></phrase>
<phrase name="setting_lucky_onoff_title" date="1198165646" username="Administrator" version="1.2.0"><![CDATA[Enable the Lucky Thread]]></phrase>
<phrase name="settinggroup_luckyset" date="1198165624" username="Administrator" version="1.2.0"><![CDATA[Lucky Thread]]></phrase>
</phrasetype>
</phrases>
<options>
<settinggroup name="luckyset" displayorder="65535">
<setting varname="lucky_onoff" displayorder="10">
<datatype>boolean</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>1</defaultvalue>
</setting>
<setting varname="lucky_group" displayorder="20">
<datatype>free</datatype>
<optioncode><![CDATA[" . eval('$options = "";
foreach($vbulletin->usergroupcache AS $usergroupid => $usergroup)
{
$options .= "\\t\\t<label for=\\"setting[$setting[varname]]$usergroupid\\" title=\\"usergroupid: $usergroupid\\"><input type=\\"checkbox\\" tabindex=\\"1\\" name=\\"setting[$setting[varname]]"."[]\\" id=\\"setting[$setting[varname]]$usergroupid\\" value=\\"$usergroupid\\"" . iif(strpos(",$setting[value],", ",$usergroupid,") !== false, \' checked="checked"\') . iif($vbulletin->debug, " title=\\"name="setting[$setting[varname]]"\\"") . " />$usergroup[title]</label><br />\\n";
}
return "<span class=\\"smallfont\\">\\n$options\\t</span>";') . "]]></optioncode>
<defaultvalue>6,28,29,32</defaultvalue>
</setting>
<setting varname="lucky_forum" displayorder="30">
<datatype>free</datatype>
<defaultvalue>0</defaultvalue>
</setting>
</settinggroup>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>
RTMdotORG
06-13-2009, 01:12 AM
<a href="https://vborg.vbsupport.ru/showpost.php?p=1828646&postcount=33" target="_blank">https://vborg.vbsupport.ru/showp...6&postcount=33</a>
this post should be right, it works for me....
DONT EDIT ANYTHING IN THE PRODUCT...
I FIXED THIS MOD ALTOGETHER!
you can edit everything through the vbulletin options>>>Lucky Thread
edytwinky
06-13-2009, 02:42 AM
I used the newest one per the last thread and received this error:
Database error in vBulletin 3.8.2:
Invalid SQL:
SELECT threadid, dateline, visible FROM xxxcthread WHERE NOT ISNULL(threadid) AND visible = '1' AND thread.forumid NOT IN (9, 10, 12, 16, 17, 18, 22, 25, 29, 30, 32, 34, 37, 39, 43, 46, 55,17,18,29,30) ORDER BY RAND() LIMIT 1;
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Request Date : Friday, June 12th 2009 @ 11:42:01 PM
Error Date : Friday, June 12th 2009 @ 11:42:02 PM
Script : http://forums.xxx.com/misc.php?do=lucky
Referrer :
IP Address : 68.102.23.100
Username : xxx
Classname : vB_Database
MySQL Version : 5.0.77-community
RTMdotORG
06-13-2009, 02:58 AM
try this one....thread.forumid is incorrect call...thats why...
edytwinky
06-13-2009, 04:38 AM
Works Great Now!!!
Thanks a bunch!
RTMdotORG
06-16-2009, 07:39 PM
anyone else confirm this?
Sweeks
06-16-2009, 08:06 PM
Confirmed working perfectly 3.8.2 :) are forum perms already working with this or do you need to add the forums to the list?
________
Gnosticism forums (http://www.religionboard.org/gnosticism/)
RTMdotORG
06-16-2009, 08:29 PM
Confirmed working perfectly 3.8.2 :) are forum perms already working with this or do you need to add the forums to the list?
its working...i fixed completely...:D
Sweeks
06-16-2009, 08:29 PM
Excellent and thank you very much! Re-installed!
________
Thai recipes (http://www.cooking-chef.com/thai/)
edytwinky
06-17-2009, 02:58 AM
Yes it has become my boards favorite new feature.
aztecboi2003
06-17-2009, 03:17 AM
Work's great, thanks for fixing this.
New Joe
07-13-2009, 02:35 AM
try this one....thread.forumid is incorrect call...thats why...
I was having the same problem with the smiles page showing, this one got it working again.
drsli
09-12-2009, 04:51 PM
Ive Fixed It!!!
Thanks a lot to the programmer and you! :)
edytwinky
10-31-2009, 12:25 AM
You think this will be easy to re-write for vBulletin 4.0?
Scalemotorcars
12-19-2009, 02:38 AM
How do I edit this to open in the same window rather then open a new one?
I looked for target= so I could set to self but I just couldn't find it. Thanks...
New Joe
02-05-2010, 04:02 AM
Hope this comes out for vB4.
edytwinky
02-07-2010, 07:31 PM
I've messaged one of the guys who fixed this hack to see if it'd be possible for a 4.0 upgrade
mgurain
02-08-2010, 05:37 AM
It works on default style but in the custom style!
Because my custom style put navbar button in the header,
How can I put the link over there ?
Thanks,,
Scalemotorcars
02-27-2010, 02:37 PM
Is the mod dead? I see the dev doing 4.0 mods. :confused:
Please let me know where to edit so it opens in the same window. target= but I cant find it in the templates.
Thanks....
edytwinky
05-22-2010, 02:46 PM
I believe so. Atakan made the original mod but a couple other coders fixed it for 3.8
edytwinky
05-24-2010, 12:40 AM
Anybody want to chip in and pay a coder to have this upgraded to 4.0? I've been quoted a price of $25 to have this upgraded for vb4.0
mgurain
06-13-2010, 09:27 AM
Hi,
there is a problem with the mod,
- when I select multiple allowed usergroups and save then all are erased !
can you please fix it for 3.8.x ?
thanks,,
SpeedJunkyz
06-13-2010, 01:50 PM
Ok its in the 3.8x forum but does not work for it? :/
matthewhotdude
06-13-2010, 01:53 PM
Anybody want to chip in and pay a coder to have this upgraded to 4.0? I've been quoted a price of $25 to have this upgraded for vb4.0
Dunno maybe you should ask in the 4.0 forum
RTMdotORG
06-19-2010, 02:22 AM
I've posted the fix here...
https://vborg.vbsupport.ru/showpost.php?p=1828741&postcount=37
lukdesigns
12-09-2010, 05:20 AM
I was looking for this! Thanks mate!
installed :)
edytwinky
09-29-2011, 04:01 AM
Anybody know if this is available on 4.x?
drayim
11-15-2011, 08:46 AM
Fixed vbulletin 4 please...
Atakan bey bunu vbulletin 4 de günceleyemeyiz mi?
Moncha
03-07-2012, 09:17 PM
Works fine in 4.1.11, I created a link my self to it and works as advertised.
Use your forum path with this at the end to create the link
misc.php?do=lucky
New Joe
03-17-2012, 06:12 AM
Works fine in 4.1.11, I created a link my self to it and works as advertised.
Use your forum path with this at the end to create the link
misc.php?do=lucky
It works but gives an error at the top of pages:
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: lucky in [path]/includes/functions.php on line 4293
edytwinky
04-02-2012, 02:53 AM
Works fine in 4.1.11, I created a link my self to it and works as advertised.
Use your forum path with this at the end to create the link
misc.php?do=lucky
Yes, in testing this an error comes up top
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.