vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   A radio-button selector to denote the type of that thread? (https://vborg.vbsupport.ru/showthread.php?t=28873)

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:
Code:

<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:
PHP Code:

      $title $threadtype.": ".$title

right BEFORE this:
PHP Code:

      $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes(htmlspecialchars($postusername))."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')"); 

In newthread.php, add this:
PHP Code:

      $title $threadtype.": ".$title

right BEFORE this:
PHP Code:

      $DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,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:
PHP Code:

if ($threadtype) {
  
$title $threadtype.": ".$title;


NOT this:
PHP Code:

$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:
PHP Code:

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

PHP Code:

      $title $threadtype.": ".$title

right BEFORE this:
PHP Code:

      $DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,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
PHP Code:

$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! ^_^


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01179 seconds
  • Memory Usage 1,781KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (10)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete