Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Lucky Thread Details »»
Lucky Thread
Version: 2.00, by Atakan KOC Atakan KOC is offline
Developer Last Online: Mar 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.8.x Rating:
Released: 10-27-2008 Last Update: Never Installs: 51
Uses Plugins Auto-Templates
 
No support by the author.

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

Download Now

File Type: xml product-lucky.xml (5.6 KB, 352 views)

Screenshots

File Type: jpg resimxx11.jpg (54.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 06-12-2009, 10:33 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

im working on fixing this....
Reply With Quote
  #33  
Old 06-12-2009, 10:44 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ive Fixed It!!!

Upload New XML Here!!!

go to edit templates>>>navbar>>
Find:
Code:
vbphrase[faq]</a></td>
Add After:
Code:
<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>

Working on adding auto templates...
Attached Files
File Type: xml product-lucky.xml (6.1 KB, 25 views)
Reply With Quote
  #34  
Old 06-13-2009, 01:00 AM
edytwinky edytwinky is offline
 
Join Date: Aug 2007
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried again and had the error:

PHP Code:
Database error in vBulletin 3.8.2:

Invalid SQL:
SELECT threadiddatelinevisible 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,30ORDER BY RAND() LIMIT 1;

MySQL Error   Unknown column 'thread.forumid' in 'where clause'
Error Number  1054
Request Date  
FridayJune 12th 2009 09:59:38 PM
Error Date    
FridayJune 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:

PHP Code:
<?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_template('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=&quot;setting[$setting[varname]]&quot;\\"") . " />$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>
Reply With Quote
  #35  
Old 06-13-2009, 01:12 AM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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
Reply With Quote
  #36  
Old 06-13-2009, 02:42 AM
edytwinky edytwinky is offline
 
Join Date: Aug 2007
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used the newest one per the last thread and received this error:

PHP Code:
Database error in vBulletin 3.8.2:

Invalid SQL:
SELECT threadiddatelinevisible FROM xxxcthread WHERE NOT ISNULL(threadid) AND visible '1' AND thread.forumid NOT IN (910121617182225293032343739434655,17,18,29,30ORDER BY RAND() LIMIT 1;

MySQL Error   Unknown column 'thread.forumid' in 'where clause'
Error Number  1054
Request Date  
FridayJune 12th 2009 11:42:01 PM
Error Date    
FridayJune 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 
Reply With Quote
  #37  
Old 06-13-2009, 02:58 AM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try this one....thread.forumid is incorrect call...thats why...
Attached Files
File Type: xml product-lucky.xml (6.1 KB, 60 views)
Reply With Quote
  #38  
Old 06-13-2009, 04:38 AM
edytwinky edytwinky is offline
 
Join Date: Aug 2007
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works Great Now!!!

Thanks a bunch!
Reply With Quote
  #39  
Old 06-16-2009, 07:39 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone else confirm this?
Reply With Quote
  #40  
Old 06-16-2009, 08:06 PM
Sweeks Sweeks is offline
 
Join Date: Jul 2008
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #41  
Old 06-16-2009, 08:29 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sweeks View Post
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...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08248 seconds
  • Memory Usage 2,384KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete