Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Prev Previous Post   Next Post Next
  #39  
Old 11-27-2001, 06:16 PM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

. ...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
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:40 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07843 seconds
  • Memory Usage 3,540KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (40)post_thanks_box
  • (40)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (40)post_thanks_postbit_info
  • (40)postbit
  • (40)postbit_onlinestatus
  • (40)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete