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 06-24-2005, 11:01 AM
Whissi Whissi is offline
 
Join Date: Jun 2005
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default First Post per Page

Hello,

I want, that every first post per site appears with ads (see the sceenshot).
I think, that I have to edit the "postbit-" template, I am using and add the code with conditionals. But this the problem: $perpage or $page doesn't work!

I tried
Code:
<if condition="$postcount == ($perpage * $page +1)">
Can someone help me please?
Attached Images
File Type: jpg shouldbe.JPG (46.2 KB, 0 views)
Reply With Quote
  #2  
Old 06-24-2005, 11:29 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have you tried
Code:
"$post[postcount] == 1"
Reply With Quote
  #3  
Old 06-24-2005, 11:37 AM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
have you tried
This will also show up in announcements and PMs....

You should also make sure that this is a thread-retrieved post.
Reply With Quote
  #4  
Old 06-24-2005, 11:56 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
THIS_SCRIPT==showthread AND $post[postcount] == 1
Reply With Quote
  #5  
Old 06-24-2005, 01:02 PM
Whissi Whissi is offline
 
Join Date: Jun 2005
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But what if, if the thread has got about 2 or more pages? Every first post per page should show it.
Reply With Quote
  #6  
Old 06-24-2005, 01:18 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

O hmm then you need to edit the source code and make a custom counter
Reply With Quote
  #7  
Old 06-24-2005, 01:53 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FIND IN showthread.php:
Code:
		$post['musername'] = fetch_musername($post);
		$post['islastshown'] = ($post['postid'] == $lastpostid);
REPLACE WITH:
Code:
		$post['musername'] = fetch_musername($post);
		$post['islastshown'] = ($post['postid'] == $lastpostid);
// ================================================= \\
// == [ MODIFIED - GTP BEGIN ]
		$post['isfirstshown'] = ($post['postid'] == $FIRSTPOSTID);
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
NOW IN postbit TEMPLATE:

FIND (at the bottom):
Code:
<if condition="$show['spacer']">
	</div>
	$spacer_close
</if>
<!-- / post #$post[postid] -->
REPLACE WITH:
Code:
<if condition="$post['isfirstshown'] OR $post['islastshown']">
<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="thead">Sponsors</td>
	<td class="alt1">
		<if condition="$post['isfirstshown']">this is the first post of every page
		<else />
		this is the last post of every page</if>
	</td>
</tr>
</table>
</if>

<if condition="$show['spacer']">
	</div>
	$spacer_close
</if>
<!-- / post #$post[postid] -->
Reply With Quote
  #8  
Old 06-24-2005, 02:06 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a question Princeton. Why do you use REPLACE instruction? No offence, but i always try to avoid them.
Reply With Quote
  #9  
Old 06-24-2005, 02:34 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have found that most addon instructions use the following:
REPLACE, EDIT ADD BELOW, ADD ABOVE, CHANGE TO, ETC.

When you use a variety of the above in your addon instructions there is an increased chance that people will encounter errors (when copy/paste).

Here's your typical addon instructions:
ADD BELOW
ADD BELOW
ADD BELOW
ADD BELOW
ADD ABOVE
REPLACE
ADD ABOVE
ADD BELOW

VS.

REPLACE
REPLACE
REPLACE
REPLACE
REPLACE
REPLACE
REPLACE
REPLACE

Using REPLACE does the same job but it decreases errors.

LOL ... it's not full-proof but it has worked for me.
Reply With Quote
  #10  
Old 06-24-2005, 02:35 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Why do you use REPLACE instruction? No offence, but i always try to avoid them.
I agree. If you are not modifying the original code, it is better to post "add before" or "add after" instruction. So that if the code is a little bit different " due to another vb version ", it would be easier for new people to hack.

P.S. IMO, vB.org should post some hacking standards...

P.P.S. The minimod itself is good, good job princeton.
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 06:58 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.04437 seconds
  • Memory Usage 2,274KB
  • Queries Executed 14 (?)
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
  • (7)bbcode_code
  • (2)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
  • (1)postbit_attachment
  • (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_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
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete