The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#41
|
||||
|
||||
. ...Ugh... ok. You asked for it.
. . <? require('Hooperslongwindedpostandexplaination.php' ); require('Crinoslongwindedbinarysigthatneedsdeciphe red.php'); } //Start long winded post on my experience. God I love this. //. //. print" News Style Postbit Hack- by FireFly Status of version: (Opinion is beta. No official release by FireFly. I know of only 2 others at this point besides myself that have it installed. It works and I haven't found any glitches up to this point. If a version number gets assigned to this FirFly himself will be doing it. Use this hack at your own risk of course.) What it does: Adds the ability to design a news type post_bit template that will be used when called to. This new template redirect adds ability to gain a new news style thread display while allowing users to post to such. You can set forumID variables for specific forums. Additional Note: Please read this post completely before attempting this hack. Difficulty: The hack itself is not very hard in complexity for your average experienced hack installer. But the template changes require an experienced level of expertice to get the desired output (look and feel) you desire. Overall: I would reccomend this hack to advanced users (At the least advanced in the template altering arena). This hack can quite possibly fubar your schtuff in Netscape when you alter the templates if not careful. Be sure to test with both browsers.) Support: This is an unofficial hack as mentioned. I'm sure others will help where they can but few are using this as of now. This is the first post that brings together an experienced installation as well as the original posting by FireFly at vBulletin. Link is below. Examples: My site is off limits at this point. Amy's site is posted in this thread. If she gives permission I will edit this post and add her site link here. Files to change (2) Showthread.php Functions.php (admin dir) Templates to change (2) 1 new one = postbit_first 1 old=showthread Original hack design located here. http://vbulletin.com/forum/showthrea...ght=first+post -------------------------------------------------------------------------------- //Start Hack Do: In showthread.php, replace $postbits .= getpostbit($post); with: if ($counter==1 and $pagenumber==1 and (($thread['forumid']==72)or($thread['forumid']==76))) { $postbits .= getpostbit($post,1, $thread['threadid']); } else { $postbits .= getpostbit($post,0,$thread['threadid']); } Note: Line 1 is the forums that will be using the postbit_first template. Set the forums you wish to use with the new postbit_first there. Now, in functions.php replace: function getpostbit($post) { with: function getpostbit($post,$isfirst=0) { Also in functions.php replace: // do posts from ignored users if (!$ignore[$post[userid]]) { eval("\$retval = \"".gettemplate("postbit")."\";"); } else { eval("\$retval = \"".gettemplate("postbit_ignore")."\";"); } with: // do posts from ignored users and create first post if ($isfirst and !$ignore[$post[userid]]) { eval("\$retval = \"".gettemplate("postbit_first")."\";"); } elseif (!$ignore[$post[userid]]) { eval("\$retval = \"".gettemplate("postbit")."\";"); } else { eval("\$retval = \"".gettemplate("postbit_ignore")."\";"); } Still in functions PHP find: // global options global $showdeficon,$displayemails,$enablepms,$allowsigna tures,$wordwrap,$dateformat,$timeformat,$logip,$re placewords,$postsperday,$avatarenabled,$registered dateformat,$viewattachedimages; and replace with: // global options global $showdeficon,$displayemails,$enablepms,$allowsigna tures,$wordwrap,$dateformat,$timeformat,$logip,$re placewords,$postsperday,$avatarenabled,$registered dateformat,$viewattachedimages,$threadid; (Note: All you did here is add $threadid to the list of global options. You may find it easier to just add $threadid; to the end of the global.) CREATE A NEW STYLE (Example:news) Now create a dupicate of your style by downloading and reuploading if you like. Remame it to news or what have you. NOTE: To keep from gettting two duplicate names of your styles confused on import, if you download your normal style to your hard disk, open it up, look at the three names between the ///// name/////name/////name.... at the top of the style, you can rename the style here before reupping it to the CP. This allows you to keep from getting confused with what style is what. vBulletin allows for same name styles. After changing the name in the 3 places at the top of the style, save the style as the rename you gave it at the top. example: news.styl and import it. Now: CREATE A NEW TEMPLATE (postbit_first) within the new news style. Create a template called postbit_first Then: Copy your postbit template from your normal style to the new news style. (This is the one you will be editing) Note: The reason you are creating a new style for the addition of the Postbit_first template is that you do not want all of your forums posts to have the news look. Only certain designated forums. The reason you copy your style and rename it news or what have you is that you indeed do not want to rehack all of your templates. This will allow you to have a news look in certain forums with not much hassle. The hardest part about this situation is getting two files to work together in harmony. They are: Showthread Postbit_first NEXT: Edit your postbit_first and showthread templates to get desired look and feel. This will be done within the new style set. Most likely you will be modifying both of the files to get the desired out put and this is the hardest part of the hack. I would say that this hack is for the advanced simply because of the problems you may have between the postbit_first and showthread changes that you will most likely make. -------------------------------------------------------------------------------- // A moment to think. Thinking doesn't always work for me. It may however work for you. If you take a moment to think about what this hack is doing you'll find that: 1) If certain forum id's are not selected, you will be using your standard postbit templates etc.... 2) If a query is made to the db for the certain forum id's you have set above is called, you then have started the use of the news.style and the templates within. // Stop thinking now. To much noise. ---- NOTE: You will need to set whatever forums you desire to use the news type style for each of your forums. Example: Style Options Custom style set for this forum Default "News" Override users custom styles (will force this forum's specified colors) "YES" --- That's it for the hack. Many thanks to FireFly (Chen) for this added professional functionality. It is an asset. And a special thank you goes to Amy Khar for help with the installation and troubleshooting. Along with this hack, a custom php integrated news script and FirFly's Advertisment hack, My forums become more professional by the day. Thank You. //end hack (start of crap blowing up) --------------------------------------------------------------- ADDITIONAL INFORMATION: Many will want this as an addition: Question: How do I have my postbit_first template display how many posts there have been to the thread? Answer: In functions.php, find these lines: // showthread global $counter,$firstnew,$sigcache,$highlight,$postid,$f orum; and replace them with this: // showthread global $counter,$firstnew,$sigcache,$highlight,$postid,$f orum,$thread; Note: all you did here was add the $thread to the end of the global list. Now: Add this..... $thread[replycount] ... to the postbit_first template you created. Of course where you want the count of replies to the news article to show up. Question: Why do I have to have another style for the postbit_first template? Answer: Go ahead and try not using a seperate style if you like. I emailed Amy on a problem I encountered and she gave me this solution. It worked for me, and I am happy with it. Question: I cannot get my showthread and new postbit_first templates to give me the desired look and feel. Everything gets messed up. Answer: Good luck. This hack requires an advanced level of template changing abilities. Countless hours can be spent on site design as you are well aware of. For those that get everything done within 2 hours. Very good, you did much better on the time frame than I did. Of course this post wasn't here either! -------------------------------------------------------------------------------- Special thanks to: AmyKhar - for bringing this hack out of the closet. FireFly - for producing it. Me- for using it. Mods/Admins are welcome to move, destroy, manipulate, etc... this post. (like you need my permission. ) //Stop long winded Post? .....Yup..... ..Darn...// //now just think. If I had a long winded sig, you still wouldn't be finished reading this.// "; checkcode('fullofbull output'); if found('selfdestruct'); else('print'); } ?> tick tick tick BOOM |
#42
|
||||
|
||||
ACK!
I guess this might take some time after all Thanks a bunch! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|