Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2008, 10:00 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Alternate First Post

When trying to change the HTML of the fist post so you get a different look for the initial post (like they do for the mods section here), I've been using:

PHP Code:
<if condition="($post[postcount]=>1)"

But I don't think that's the best way to do this. And I've been searching for hours now, but postbit is such a common term here, that I can't really make any headway. What's the best way to achieve the look that they use here on vb.org? I'm using an alternate style to accomplish this. But I want the first post to be the only thing different.
Reply With Quote
  #2  
Old 05-01-2008, 10:07 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this what you are looking for..?

https://vborg.vbsupport.ru/showthread.php?t=156141



Good luck.
Reply With Quote
  #3  
Old 05-01-2008, 10:21 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps even more then I was looking for. Didn't expect to find something that kept the post on every page. Thanks. I'll consider it.

But, I was hoping to be able to do the editing manually. Something more along the lines of some basic <if> conditionals and where to put them.
Reply With Quote
  #4  
Old 05-01-2008, 03:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm playing with this on my test site. I only wanted to change the first post for one of my forums though. I created a plugin at "postbit_display_complete" and put in:

PHP Code:
 if ($this->forum['forumid']==xx AND $post['postid']==$this->thread['firstpostid'])
{
$this->templatename 'postbit_new';

In this example, xx is the forum I am using this in and I copied the postbit_legacy template and modified it and named it 'postbit_new'. It's very simple and works just fine.
Reply With Quote
  #5  
Old 05-03-2008, 05:08 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was hoping for something straightforward just like that. I'll give it a try and post back. Thanks a bunch.
Reply With Quote
  #6  
Old 05-04-2008, 07:40 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hrm, seems I get one of those repetitive Parse error: syntax error, unexpected '{' in FILE PATH/includes/class_postbit.php(296) : eval()'d code on line 207 at the top of the page. No changes either. Should I have made a file edit to postbit.php as well?


EDIT: Hrm, it appears there was a parenthesis missing in the plugin code. At the very least, changing this [firstpostid]) to this [firstpostid])) took care of my problem. <perplexed>

--------------- Added 04 May 2008 at 05:20 ---------------

Another quick question, if you don't mind. Do I need to create a separate plugin for each forum ID, or can I separate forum IDs in the plugin code just by separating them with a comma?
Reply With Quote
  #7  
Old 05-04-2008, 12:01 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Another quick question, if you don't mind. Do I need to create a separate plugin for each forum ID, or can I separate forum IDs in the plugin code just by separating them with a comma?
Use:
PHP Code:
if(in_array($this->forum['forumid'], array(XXYYZZ)) AND $post['postid'] == $this->thread['firstpostid'])
{
    
$this->templatename 'postbit_new';

Reply With Quote
  #8  
Old 05-04-2008, 03:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
EDIT: Hrm, it appears there was a parenthesis missing in the plugin code. At the very least, changing this [firstpostid]) to this [firstpostid])) took care of my problem. <perplexed>
Whoops. Looks like when I copied the code from my template and erased part of it, I left an extra parenthesis in there. Sorry about that. I fixed it above. If you want it for several forums, see Opserty's post to use the array for forumids.
Reply With Quote
  #9  
Old 05-06-2008, 11:35 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Heheh, that's okay. Seems to be working perfectly for me. Many thanks to both of you. I created a template called postbit_articles with the custom HTML, and it's working just the way I had hoped. The only minor little thing I ran into is a small null is not an object error after editing a post in the full editor. Is it possible I left something out in the recreation of the postbit?
Reply With Quote
  #10  
Old 05-06-2008, 01:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Heheh, that's okay. Seems to be working perfectly for me. Many thanks to both of you. I created a template called postbit_articles with the custom HTML, and it's working just the way I had hoped. The only minor little thing I ran into is a small null is not an object error after editing a post in the full editor. Is it possible I left something out in the recreation of the postbit?
It's possible, but what I would do is do a bit of investigation. If you get that error every time you edit, then try turning off the plugin that uses this new template and then go to edit it again (it will then be using the old template) and see if you still get the error.
Reply With Quote
Reply


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 11:08 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.04355 seconds
  • Memory Usage 2,269KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (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_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete