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?


All times are GMT. The time now is 10:07 AM.

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.01138 seconds
  • Memory Usage 1,752KB
  • 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
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete