PDA

View Full Version : End-User Options - Lucky Thread


Atakan KOC
20 Dec 2007, 14:50
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.

Mark as Installed (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=165704) - Nominate for MOTM (http://www.vbulletin.org/forum/vborg_miscactions.php?do=nominate&threadid=165704&type=1)


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

Mark as Installed (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=165704) - Nominate for MOTM (http://www.vbulletin.org/forum/vborg_miscactions.php?do=nominate&threadid=165704&type=1)


Manuel Template Change

Open navbar template

vbphrase[faq]</a></td>add below

<td class="vbmenu_control"><a href="misc.php?do=lucky">$vbphrase[lucky]</a></td>

Atakan KOC
20 Dec 2007, 14:51
v1.2 - 20 December 2007
- vBulletin 3.7
- Project name change "Lucky Button => Lucky Thread"
- Small Phrase change

katilkuzu
20 Dec 2007, 14:51
hmm reserved... i ll try

kaptanblack
20 Dec 2007, 15:13
Thanks

Snake
20 Dec 2007, 16:22
Many thanks for the release!

yahoooh
20 Dec 2007, 17:58
can be depend in usergroup?

semauae
20 Dec 2007, 17:59
thnx

I want to choose the luky thread from the new threads only

can I ?

Hornstar
21 Dec 2007, 02:49
Just wondering, will this try and send a normal member into a staff only section (but give them the no permission error) OR will it only send them to forums they have permission to view in the first place.

blastup
21 Dec 2007, 06:38
i like this idea.. is there a way it can be turn to include just the thread id..just a group of threads that it will display random from .. it would be to much of a hassle to then to exclude all of the categories. let me know asap thanks

Mazinger
21 Dec 2007, 10:31
Does this work on 3.6.8?

IrPr
21 Dec 2007, 11:38
Does this work on 3.6.8?


Check this out: http://www.vbulletin.org/forum/showthread.php?t=160816

Thanks Atakan

Traxdata
30 Dec 2007, 19:11
does not work for me on 3.7.b3.
product installed, navbar changed - no problems at all. but when i click on lucky thread in my navbar then all is see are my smilies. changed location for lucky thread in navbar - still the same. my other members can confirm it.
in acp i disallowed some forums and afterwards all usergroups were unselected. tried to select _ without luck. when i click on save i see unselected usergroups again. very strange.
product disabled.

halkum
08 Feb 2008, 17:22
does not work for me on 3.7.b3.
product installed, navbar changed - no problems at all. but when i click on lucky thread in my navbar then all is see are my smilies. changed location for lucky thread in navbar - still the same. my other members can confirm it.
in acp i disallowed some forums and afterwards all usergroups were unselected. tried to select _ without luck. when i click on save i see unselected usergroups again. very strange.
product disabled.

Same issue. Worked right once, then stuck on smilies

binevi
09 Feb 2008, 01:15
i got same problem too. If it works properly that would be great hack ;)

halkum
14 Feb 2008, 23:33
this needs to be fixed or scrapped.

vanpelt
09 Mar 2008, 05:30
It works for me. I've called it 'Lucky Dip". Thanks for the mod.

mgurain
21 May 2008, 06:25
Just wondering, will this try and send a normal member into a staff only section (but give them the no permission error) OR will it only send them to forums they have permission to view in the first place.

same,,

Chadi
29 May 2008, 03:40
This is not working for me on 3.7.1

I imported the xml, did manual template edits. For one thing, nothing shows up in navbar. Second, the vboptions > luck thread area does not save my settings. I check the admin, mod, super mod and member usergroup. Click save. It refreshes, then nothing is checked.

Also, the plugin is enabled/active. On top of that, if I manually add the link on forumhome side column, it shows up. However, clicking the link takes me to the smiley list page instead. VBSEO conflict?

aykolandforum
02 Jun 2008, 11:48
thanks..

Chadi
03 Jun 2008, 18:07
I can confirm vbseo is not causing this as the link still redirects to smiley list page when vbseo is disabled.

Anyone else have this problem?

Opserty
04 Jun 2008, 15:56
Try this...


AdminCP > Plugins & Products > Plugin Manager

From the list look for:
Lucky admin_options_processing [Edit] [Delete]
Click [Edit].

Change the PHP Code (the bit in the big box) to:
if (is_array($settings['lucky_group']))
{
$settings['lucky_group'] = implode(',', $settings['lucky_group']);
}
It should work, I hope.

Chadi
04 Jun 2008, 18:05
Try this...

AdminCP > Plugins & Products > Plugin Manager
From the list look for:
Click [Edit].
Change the PHP Code (the bit in the big box) to:
if (is_array($settings['lucky_group']))
{
$settings['lucky_group'] = implode(',', $settings['lucky_group']);
}
It should work, I hope.

Thank you. Unfortunately it still redirects to the smiley list.

Opserty
05 Jun 2008, 12:18
Make sure you re-save the settings for the modification in vBulletin Options. It works for me on 3.7.1

binevi
05 Jun 2008, 23:14
<defaultvalue>2,5,6,7</defaultvalue> that gives permission to some usergroup

what i done is i put all the usergroups number and save it and than import is as a product.


try to install attachment if it doesnt work i cant say anything else ;D

anyway it works for me properly

Opserty
06 Jun 2008, 09:04
binevi did you try the instructions I provided? If you did, did they work? (Your method won't allow you to change settings for this product in future).

Ninth Dimension
06 Jun 2008, 12:17
There is an error in the code in one of the plugins.

Edit the 'misc_start' code within the plugin manager and replace with this:
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 != "") {
$excludedforums = "AND " . TABLE_PREFIX . "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']);
}
}
}

If you want to know what I've changed, you'll see a new " . TABLE_PREFIX . " contained within this section of code if ($excludedforums != "") {
$excludedforums = "AND " . TABLE_PREFIX . "thread.forumid NOT IN ($excludedforums)";
}

I hope this helps someone :)

binevi
06 Jun 2008, 13:47
binevi did you try the instructions I provided? If you did, did they work? (Your method won't allow you to change settings for this product in future).
There wasnt any explaination when i installed this product. thats why i find it by my self. I tried your method it works ;)

formunda
07 Jun 2008, 09:53
Thanks Atakan :)

Chadi
11 Jul 2008, 23:47
edit, nevermind :)

ErrorLog
25 Jul 2008, 10:49
Eyvallah Atakan KOÇ !!

İnstalled =}

PoetJA-1975
05 Aug 2008, 08:31
Try this...


AdminCP > Plugins & Products > Plugin Manager

From the list look for:

Click [Edit].

Change the PHP Code (the bit in the big box) to:
if (is_array($settings['lucky_group']))
{
$settings['lucky_group'] = implode(',', $settings['lucky_group']);
}
It should work, I hope.
Thanx = Now works wonderfully on 3.7.2 PL1
Thanx ATAKAN :)

Jacquii.

yingzhou
19 Aug 2008, 14:01
interesting!!!

Chadi
05 Oct 2008, 19:27
I don't know what happened but I'm still getting redirected to the smiley page. It was working fine until today when I noticed it happening.

I applied osperty's method, did not work.

When I originally uploaded the template, I first changed all reference of the word "lucky" to "stumble" instead as we Christians do not believe in "luck".

Anyway, template is called "stumble" in the template list as it was and should be.

The code in the plugin is this:

if (is_array($settings['stumble_group']))
{
$settings['stumble_group'] = implode(',', $settings['stumble_group']);
}

The template called "stumble" has this

<td class="vbmenu_control"><a href="misc.php?do=stumble">$vbphrase[stumble]</a></td>

Chadi
11 Oct 2008, 22:12
Would appreciate help on this. Thanks.

Chadi
18 Oct 2008, 19:43
Would appreciate any help on this.

vithorius
18 Oct 2008, 22:45
This is an interesting Mod, but I see that there is not much support from the coder, right...?!? :confused: :(


I would like to install it, but it would have to have some way to disable some of my sub-forums... (I really would not like to have Classifieds on the "Lucky Thread")

Chadi
29 Oct 2008, 18:02
Uninstalled since it does not work.

RTMdotORG
13 Jun 2009, 01:01
I Have Fixed This MOD....
Do The Same Template Edits...

And Install This XML....

tommac3
13 Jun 2009, 23:22
I Have Fixed This MOD....
Do The Same Template Edits...

And Install This XML....

didnt do the template edits ... but it seems to work ... do I need to do the edits?

DobieGillisİ
14 Jun 2009, 00:11
man, hit the lucky button and got transported to another dimension. One hell a mod!

RTMdotORG
14 Jun 2009, 01:09
didnt do the template edits ... but it seems to work ... do I need to do the edits?

nope i guess not, lol

gungor
06 Apr 2010, 09:16
thanks..