PDA

View Full Version : Sticky : - Important?


Automated
12-11-2002, 05:15 PM
Hi,

I have a few mods working around the forum, and they are making the posting guidelines in their own forums.

I was wondering, it would be great if there was a hack that would add an additional function to the dropdown list for the admin and mod's to select something like Important : which would have exactly the same function as the sticky onebut print important instead?

IS this possiable?

Thanks a lot :p

Matthew

Xenon
12-11-2002, 06:05 PM
search in full releases a hack called post prefixes or something like, i think you can do it with it..

Automated
12-11-2002, 06:07 PM
searching ............

N9ne
12-11-2002, 06:09 PM
I think it would be even better to add it to the vB options page in adminCP, in fact, I'll look into this and create a clone of the sticky tag, but with important...see a thread can be sticky and not important ;)

I'll look into it, not sure if I'll come out with anything lol.

Automated
12-11-2002, 06:23 PM
Thanks a lot man!

That would make a really cool hack, also can you use HTML in the tags? or am i getting greedy now ;)

Thanks
Matthew

N9ne
12-11-2002, 06:55 PM
Yes you can use html in the tags for polls, sticky, moved already...;)

I just looked around and I'm not sure where or how this whole sticky prefix is made unfortunately...+ I'm too busy...I won't be able to make it.

Automated
12-11-2002, 08:03 PM
Originally posted by N9ne
Yes you can use html in the tags for polls, sticky, moved already...;)

I just looked around and I'm not sure where or how this whole sticky prefix is made unfortunately...+ I'm too busy...I won't be able to make it.

Could anyone else have a go at this? I think it would make a really cool hack!

Thanks :banana:

Matthew

Automated
12-14-2002, 12:27 PM
please?

Automated
12-16-2002, 11:45 AM
^ Bump ^

Chris M
12-16-2002, 06:04 PM
I'll do it in a second:)

Satan

Chris M
12-16-2002, 06:09 PM
Ive done half the work for you...

All that is left for you to do is:

edit the forumdisplay template and forumdisplay.php, and copying any reference to "sticky" (including queries) and changing it to "important"...

:)

Untested, so backup;)

Open root/postings.php
Find:
// ############################### start stick / unstick thread ###############################
if ($HTTP_POST_VARS['action'] == 'stick' OR ($action == 'stick' AND $s == $session['dbsessionhash'])) {

$threadid=verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

if (!$threadinfo[visible]) {
$idname="thread";
eval("standarderror(\"".gettemplate("error_invalidid")."\");");
}

if (!ismoderator($threadinfo[forumid],"canmanagethreads")) {
show_nopermission();
}

updateuserforum($threadinfo['forumid']);

if ($threadinfo[sticky]) {
$threadinfo[sticky]=0;
$action="unstuck";
} else {
$threadinfo[sticky]=1;
$action="stuck";
}
$threadinfo[notes]= "Thread $action by $bbuserinfo[username] on ".vbdate($dateformat." ".$timeformat,time()).". $threadinfo[notes]";
$DB_site->query("UPDATE thread SET sticky=$threadinfo[sticky],notes='".addslashes($threadinfo[notes])."' WHERE threadid='$threadid'");

eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");

}

Add below:
// ############################### start important / unimportant thread ###############################
if ($HTTP_POST_VARS['action'] == 'important' OR ($action == 'important' AND $s == $session['dbsessionhash'])) {

$threadid=verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

if (!$threadinfo[visible]) {
$idname="thread";
eval("standarderror(\"".gettemplate("error_invalidid")."\");");
}

if (!ismoderator($threadinfo[forumid],"canmanagethreads")) {
show_nopermission();
}

updateuserforum($threadinfo['forumid']);

if ($threadinfo[important]) {
$threadinfo[important]=0;
$action="unimportant";
} else {
$threadinfo[important]=1;
$action="important";
}
$threadinfo[notes]= "Thread was made $action by $bbuserinfo[username] on ".vbdate($dateformat." ".$timeformat,time()).". $threadinfo[notes]";
$DB_site->query("UPDATE thread SET important=$threadinfo[important],notes='".addslashes($threadinfo[notes])."' WHERE threadid='$threadid'");

eval("standardredirect(\"".gettemplate("redirect_important")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");

}

Save root/postings.php

Run this Query:
ALTER TABLE thread ADD important smallint(6) DEFAULT '0' NOT NULL

Add this template: redirect_important
The thread has been successfully made $action. You are now being taken to the thread.

Edit this template: showthread_adminoptions
Find:
<option value="stick">Stick / Unstick Thread</option>
Replace with:
<option value="stick">Stick / Unstick Thread</option>
<option value="important">Important / Unimportant Thread</option>

Satan

Chris M
12-16-2002, 06:10 PM
Oh...

And you will need to add a vBulletin Options Setting for the "text to display" if the thread is Important;)

Satan

Automated
12-17-2002, 03:03 PM
Originally posted by hellsatan
Oh...

And you will need to add a vBulletin Options Setting for the "text to display" if the thread is Important;)

Satan

Thanks a lot man :D

One small question before i get my hack installation hat on, how do i add the option setting for the "text to display"?

Thanks a lot!

Matthew

Chris M
12-18-2002, 08:55 PM
Right...

Open up your admin/config.php file, and add:

$debug="1";
(remember to remove once you have finished!)

Upload it to your admin folder, then open up your Admin Control Panel...

On the Sidebar, there should be new options underneath "vBulletin Options"...

Click the "Edit Settings" button, and find where the "Sticky", "Moved" and "Poll" prefixes are...

Shift+Click on "edit", and then click on "add setting" on the first page (not the one you just opened)...Simply copy the data from the second window to the first, then change the Data to suit the "important" version:)

Then Add the new setting, close the second window, and then remove the "$debug" variable from admin/config.php:)

Satan

Automated
12-18-2002, 09:07 PM
Thanks a lot for that hellsatan i will install in the morning :p

Matthew

Chris M
12-19-2002, 09:20 AM
:)

No problem:)

Satan

Automated
12-19-2002, 02:19 PM
Quick Question: What would the variable name be? "importantthreadprefix" ?

Thanks
Matthew

Automated
12-19-2002, 02:26 PM
I have done everything above but nothing comes up :(

Chris M
12-19-2002, 02:51 PM
Have you made the changes to forumdisplay.php?:)

Satan

Automated
12-19-2002, 05:08 PM
What changes need to be made?

Chris M
12-20-2002, 08:40 AM
Ive done half the work for you...

All that is left for you to do is:

edit the forumdisplay template and forumdisplay.php, and copying any reference to "sticky" (including queries) and changing it to "important"...

Satan

Automated
12-20-2002, 01:33 PM
Originally posted by hellsatan


Satan

I will have a go but i am a real newbie, I am doing well following the installation instructions that people have made :(

Thanks
Matthew

Automated
12-22-2002, 07:24 PM
^ Bump ^ Sorry to be a pain but what mod's to do i have to make to the forumdisplay.php page?

Thanks
Matthew

DarkDraco07
12-22-2002, 07:36 PM
if u want it to say Important instead of Sticky just go to the admin cp and then vb options, change the word sticky to important. now whenver u stick a thread, it will say important

Automated
12-24-2002, 10:05 AM
Originally posted by Automated
^ Bump ^ Sorry to be a pain but what mod's to do i have to make to the forumdisplay.php page?


Thanks
Matthew

Please :p

Chris M
12-24-2002, 04:32 PM
I will get back to you soon:)

Satan