vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




Thread Type Hack

lily143
08-21-2005, 12:48 PM
#################################
#Hack: Thread Type Hack
#Hack By: Tim "eXtremeTim" Yarbrough
#Created For: http://www.extremechatforums.com/forum/index.php
#Live Demo : ( ID: 143 password: test ) http://www.efz-tm.net/forums/newthread.php?do=newthread&f=130
#################################
#If you like this hack please click install.
#################################
#NOTES
#As with any hack please backup your files and database before installing.
#################################

####################
#Files to be edited#
####################
#root/newthread.php
#root/forumdisplay.php
#root/includes/functions_newpost.php
####################

########################
#Templates to be edited#
########################
#newthread
#threadbit
########################

################
#Queries to run#
################

ALTER TABLE `thread` ADD `threadtype` VARCHAR( 30 ) NOT NULL ;

################

#####################
#Start of file edits#
#####################

###############
#Open root/newthread.php
###############

######
#Find#
######

$newpost['posthash'] = $posthash;

###########
#Add Below#
###########

//Thread Type Hack By Tim "eXtremeTim" Yarbrough for http://www.extremechatforums.com/forum/index.php
$newpost['threadtype'] = $_POST['threadtype'];
//End Thread Type Hack By Tim "eXtremeTim" Yarbrough for http://www.extremechatforums.com/forum/index.php

################
#Save and close#
################

#######################
#Open root/forumdisplay.php
#######################


######
#Find#
######

deletionlog.username AS del_username, deletionlog.reason AS del_reason") . "

##############
#Replace with#
##############

deletionlog.username AS del_username, deletionlog.reason AS del_reason") . ", thread.threadtype

################
#Save and close#
################

#######################
#Open root/includes/function_newpost.php
#######################

######
#Find#
######
// ### POST NEW THREAD ###
if ($type == 'thread')
{

###########
#Add Below#
###########

$post['threadtype'] = htmlspecialchars_uni(fetch_censored_text($post['threadtype']));

######
#Find#
######

iconid, visible, attach, similar

##############
#Replace with#
##############

iconid, visible, attach, similar, threadtype

######
#Find#
######

$totalattachments, '" . addslashes($similarthreads) . "'

##############
#Replace with#
##############

$totalattachments, '" . addslashes($similarthreads) . "', '" . addslashes($post['threadtype']) . "'


################
#Save and close#
################

#########################
#Start of template edits#
#########################

################
#Open newthread#
################

######
#Find#
######

<!-- subject field -->
<table cellpadding="0" cellspacing="0" border="0" class="fieldset">
<tr>
<td class="smallfont" colspan="3">$vbphrase[title]:</td>
</tr>
<tr>
<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td>&nbsp;&nbsp;</td>
<td><if condition="$posticons"><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /><else />&nbsp;</if></td> </tr>
</table>
<!-- / subject field -->

##############
#After it add ( You should edit this list to fit your site )
##############

<!-- Thread Type field -->
<table cellpadding="0" cellspacing="0" border="0" class="fieldset">
<tr>
<td class="smallfont" colspan="3">Thread Type:</td>
</tr>
<tr>
<td><select name="threadtype" tabindex="1">
<option value=""></option>
<option value="News">News</option>
<option value="Informative">Informative</option>
<option value="Important">Important</option>
<option value="Release">Release</option>
<option value="RE-Release">RE-Release</option>
<option value="Joke">Joke</option>
<option value="Question">Question</option>
<option value="Resource">Resource</option>
<option value="Tutorial">Tutorial</option>
<option value="Image Thread">Image Thread</option>
<option value="Point Less">Point Less</option>
<option value="Other">Other (for anything else)</option>
</select></td>
<td>&nbsp;&nbsp;</td>
<td><if condition="$posticons"><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /><else />&nbsp;</if></td> </tr>
</table>
<!-- / Thread Type field -->


###########################
#Save the template changes#
###########################

################
#open threadbit#
################

######
#Find#
######

<if condition="$show['gotonewpost']"><strong>$thread[threadtitle]</strong><else />$thread[threadtitle]</if></a>

###############
#Before it add#
###############

<if condition="$thread['threadtype']"><span class="smallfont">[$thread[threadtype]]</span></if>

###########################
#Save the template changes#
###########################


That it your done. I hope you all enjoy this hack.

GuyFromChicago
08-22-2005, 08:56 AM
And this does what?

theMusicMan
08-23-2005, 06:16 AM
Ditto - I'd like to know as well. In fact, please can you let us know what it does or I might have to move it out somewhere until we are happy that it does what it is supposed to do... whatever that is!!!

Count down started...;) 24 hours pls.

contactsonia
08-23-2005, 09:19 PM
I got it what it does :D

It is an enhancement to New Thread. If you apply this hack on your forums, it will show an extra field (select box) where you can select what type of thread you are going to start. Please see attached image. I captured this image with the demo provided by lily143 :)

theMusicMan
08-24-2005, 01:00 AM
Thanks for this Sonia... very much appreciated.

You can understand our concerns here yeah, as I for one was uncertain as to what exactly the hack did, and when I see SQL Queries are needed thus;

################
#Queries to run#
################

ALTER TABLE `thread` ADD `threadtype` VARCHAR( 30 ) NOT NULL ;

... is when I would like to have seen some consistency in hack presentation and an explanation as to what was going on.

It is fine to include template hacks, even perhaps some php code changes without lots of detailed instructions, but when the underlying MySQL database is altered, this can have a significant effect on the performance and functionality etc. of a site such that I for one need to be 100% clear about allowing such a hack to be placed on a site where I have a responsibility to the membership.

Of course, Joey can fully overrule me here, but that's my rationále and $0.02c for my post.

Thanks for clarifying.

contactsonia
08-24-2005, 01:18 AM
You are quite right John :)

I also think that if somebody develops a hack he should post detailed instruction about the same i.e. what it does, features etc. etc.

sarahk
08-24-2005, 01:58 AM
I have a site idea in mind that that would be really useful for. If we get it off the ground I'll be back to test it out. In our version though the ability to change the drop down from a default setting will be limited to the Mods.

thanks

Sarah

noppid
08-24-2005, 07:20 AM
My concern is who actually owns this hack. It's obviously a cut and paste from vbulletin.org.


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum