PDA

View Full Version : A radio-button selector to denote the type of that thread?


KuraFire
09-25-2001, 01:55 PM
Heh, I'm suddenly requesting hacks on a frenzy, eh?


Ah well, this one's for the Infogrames North America board again.


Suppose, we have a forum there, the Wheel of Time Book Forum, where there are on-topic threads, roleplaying threads, and off-topic threads. Now, we would like to see a prefix used in a similar way as currently "Poll: ", "Sticky: " and "Announcement: " are used, but then have the options "WoT: ", "RP: ", and "OT: " and have those options as three radio buttons somewhere in the New Thread template/page.

This way, a user can post a thread, point out which type it is, and then that type will show up as a prefix in the same way Poll etc. do, now.

Also, this should only be visible on the WoT-specific templates, so that those three options don't show up on forums that AREN'T using the WoT Styleset.

Oh and it'd be best if none of the three prefixes is turned on by default, and that if the user doesn't select one, no prefix is used, either.


Is this possible? :)

Admin
09-25-2001, 05:52 PM
Umm, this can be done very easily, but only if the type isn't editable.

If you want it to be, I think it'll involve some more comprehensive hacking.

beatbox
09-25-2001, 10:29 PM
I'd prefer the options in all forum's - as it would probably require less hacking, not to mention detailed stuff is not needed for me.

Admin
09-26-2001, 05:24 AM
[QUOTE]Originally posted by FireFly
Umm, this can be done very easily, but only if the type isn't editable.

If you want it to be, I think it'll involve some more comprehensive hacking.

KuraFire
09-26-2001, 06:47 AM
[QUOTE]Originally posted by FireFly
Umm, this can be done very easily, but only if the type isn't editable.

If you want it to be, I think it'll involve some more comprehensive hacking.

Admin
09-26-2001, 06:57 AM
Ok.

Add something like this in your newreply and newthread templates, right after the Title row:
<tr bgcolor="{secondaltcolor}">
<td bgcolor="{secondaltcolor}"><normalfont><b>Thread type:</b></normalfont></td>
<td bgcolor="{secondaltcolor}">
<select name="threadtype">
<option value="WoT">WoT</option>
<option value="RP">RP</option>
<option value="OR">OT</option>
</select>
</td>
</tr>

Now, in newreply.php add this:
$title = $threadtype.": ".$title;
right BEFORE this:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes(htmlspecialchars($postusername))."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconi d','$visible')");

In newthread.php, add this:
$title = $threadtype.": ".$title;
right BEFORE this:
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");

That's it. Should work.

KuraFire
09-26-2001, 07:22 AM
Awesome, just one quick Q: this will ONLY work and show up in the templates in which I add that first piece, and it won't do -anything- to the newreply/newthread pages in all other templates?

Admin
09-26-2001, 07:25 AM
Oops you're right.

Use this:
if ($threadtype) {
$title = $threadtype.": ".$title;
}
NOT this:
$title = $threadtype.": ".$title;

KuraFire
09-26-2001, 07:30 AM
There we go, awesome, thanks!


Now if I can just fix the massive problem I have on my server right now (nothing works anymore *cries* Blah, stupid .htaccess is messing up! :( )


I'll tell you if I ever come across a bug or so! :)

KuraFire
09-26-2001, 08:07 AM
Heh, I just tested it, and, well.. the selector works. Buuuuuuuuuuuuuuut it doesn't quite put a prefix in front of the thread title on the forum index. Help?

Admin
09-26-2001, 08:09 AM
Can you see a ":" before the post title?

KuraFire
09-26-2001, 08:13 AM
Nope. Me thinks I need to add something in the forumdisplay template?

btw, can the selection method be through Radio buttons instead of a pull-down selection menu? So that users can also choose NOT to use a prefix?

Admin
09-26-2001, 08:31 AM
You don't need to add anything to the forumdisplay template.

Again, I ask.
Does it add the prefix to the POST title. NOT the thread title. The POST title. Right above the post, in bold.

KuraFire
09-26-2001, 08:35 AM
nope. The Prefix doesn't appear -anywhere- :(

And I'd like it to appear on the forum index in front of the thread just like Poll: etc...

Admin
09-26-2001, 08:46 AM
If you added it to newthread.php, I have no idea why it won't work.

KuraFire
09-26-2001, 08:53 AM
[QUOTE]Originally posted by FireFly
Oops you're right.

Use this:
if ($threadtype) {
$title = $threadtype.": ".$title;
}

Admin
09-26-2001, 09:02 AM
Yes.
Where did you add it?

KuraFire
09-26-2001, 09:12 AM
$title = $threadtype.": ".$title;
right BEFORE this:
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");


Right before -that- part.

Admin
09-26-2001, 09:20 AM
Don't know what could be wrong.

Try
$title = "$threadtype : $title";
:confused:

KuraFire
09-26-2001, 10:04 AM
doesn't work either :(

Admin
09-26-2001, 05:32 PM
<a href="http://www.vbulletin.com/forum/showthread.php?s=&threadid=28636" target="_blank">http://www.vbulletin.com/forum/showt...threadid=28636</a>

KuraFire
09-26-2001, 07:42 PM
Thanks, but that mip person didn't include an explanation on HOW to implement that hack - well, only one that's in German, which I'm not good enough at to use it. :(

Could you tell me how to do it? Something with the diff seems to do it automatically or so, but I have NO f***ing idea how to do such a thing, I'm still a bit of a n00b on this :/

KuraFire
11-01-2001, 08:48 PM
Now, you guys have the effect of this hack implemented on this board, but I can't find the thread or hack or whatever, which has that hack all functional and tested and everything!

I'm talking about the prefix we see on the Full Releases forum, when posting a thread one can choose a prefix for the version - I need THAT hack! :D


any pointers to the thread with this hack would be supremely appreciated! ^_^