The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter ..

Go down

PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter .. Empty PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter ..

Post by LUDAKLUDI September 6th 2008, 6:06 pm

is there anyway to add post counter in our forums ....

i add this in my forum in "PHP Templates -> General -> viewtopic_body"

"Post #"
it show on evry post without counter ... i dont know to program that ... :/

PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter .. 89693628uz1

whit this code in "viewtopic_body"
Code:

<tr>
   <th class="thHead" colspan="2" nowrap="nowrap" height="3"><div align="right">Post #:</div></th>
</tr>
i add "Post #"

but i dont know to add counter ...

ex:
for first post to show "Post #1"
for 2nd "Post #2" etc...


if someone know php to program counter(i dont know is that is possible on this way :/ ) ..... post hire code.... that will be wery cool

thx in advance ....
________________________________________



my "viewtopic_body"
Code:

<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav">
<!-- BEGIN switch_user_authpost -->
<a href="{U_POST_NEW_TOPIC}" rel="nofollow"><img src="{POST_IMG}" id="{POST_IMG_ID}" alt="{L_POST_NEW_TOPIC}" align="middle" border="0" /></a> 
<!-- END switch_user_authpost -->
<!-- BEGIN switch_user_authreply -->
<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" id="i_reply" alt="{L_POST_REPLY_TOPIC}" align="middle" border="0" /></a>
<!-- END switch_user_authreply -->
</span></td>
<td class="nav" valign="middle" width="100%"><span class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_SEP}<a class="nav" href="{U_ALBUM}">{L_ALBUM}</a>{NAV_CAT_DESC_SECOND}</span></td>
<!-- BEGIN insert_plus_menu -->
<td align="right" valign="bottom" nowrap="nowrap" width="100%"><span class="gensmall"><b>
<script type="text/javascript"><!--
insert_plus_menu('f{FORUM_ID}&t={TOPIC_ID}','{JS_SESSION_ID}', {JS_AUTH_FAVOURITES});
//-->
</script>
</b></span></td>
<!-- END insert_plus_menu -->
</tr>
</table>
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr align="right">
<td class="catHead" colspan="2" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="9%" class="noprint"></td>
<td align="center" nowrap="nowrap" class="t-title"> <h1 class="cattitle"><!-- google_ad_section_start -->{TOPIC_TITLE}<!-- google_ad_section_end --></h1></td>
<td align="right" nowrap="nowrap" width="9%" class="browse-arrows"><a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a> <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a> <a href="#bottom">{L_GOTO_DOWN}</a> </td>
</tr>
</table>
</td>
<tr><td class="row1" colspan="2" align="right" valign="top"><span class="gensmall">{PAGINATION}</span></td></tr>
</tr>{POLL_DISPLAY}<tr>
<th class="thLeft" nowrap="nowrap" width="150" height="26">{L_AUTHOR}</th>
<th class="thRight" nowrap="nowrap">{L_MESSAGE}</th>
</tr>
<!-- BEGIN postrow -->
   <!-- BEGIN displayed -->
   <tr class="post">
      <td class="{postrow.displayed.ROW_CLASS}" valign="top" width="150">
         <span class="name"><a name="{postrow.displayed.U_POST_ID}"></a><strong>{postrow.displayed.POSTER_NAME}</strong></span><br />
         <span class="postdetails poster-profile">
            {postrow.displayed.POSTER_RANK}<br />
            {postrow.displayed.RANK_IMAGE}{postrow.displayed.POSTER_AVATAR}<br /><br />
            {postrow.displayed.POSTER_GENDER}
            {postrow.displayed.ZODIAC_IMG}
            {postrow.displayed.CHINESE_IMG}<br />
            {postrow.displayed.POSTER_AGE_INT} {postrow.displayed.POSTER_AGE}
            {postrow.displayed.POSTER_JOINED_INT} {postrow.displayed.POSTER_JOINED}
            {postrow.displayed.POSTER_POSTS_INT} {postrow.displayed.POSTER_POSTS}
            {postrow.displayed.POSTER_FROM_INT} {postrow.displayed.POSTER_FROM}
            {postrow.displayed.POSTER_HOBBIES_INT} {postrow.displayed.POSTER_HOBBIES}
            {postrow.displayed.POSTER_HUMOR_INT} {postrow.displayed.POSTER_HUMOR}
            {postrow.displayed.POSTER_PERSONALIZED_PROFILE} {postrow.displayed.POSTER_RPG}
         </span><br />
      </td>
      <td class="{postrow.displayed.ROW_CLASS}" valign="top" width="100%" height="28">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td><span class="postdetails"><img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" border="0">{L_POST_SUBJECT}: {postrow.displayed.POST_SUBJECT}  <img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0">{postrow.displayed.POST_DATE}</span></td>
               <td align="right" valign="top" nowrap="nowrap" class="post-options">
                  {postrow.displayed.QUOTE_IMG} {postrow.displayed.EDIT_IMG} {postrow.displayed.DELETE_IMG} {postrow.displayed.IP_IMG} {postrow.displayed.REPORT_IMG}
               </td>
            </tr>
            <tr>
               <td colspan="2" class="hr">
                  <hr />
               </td>
            </tr>
            <tr>
               <td colspan="2"><span class="postbody"><!-- google_ad_section_start -->{postrow.displayed.MESSAGE}<!-- google_ad_section_end -->{postrow.displayed.SIGNATURE}</span><span class="gensmall">{postrow.displayed.EDITED_MESSAGE}</span></td>
            </tr>
         </table>
      </td>
   </tr>
   <tr>
      <td class="{postrow.displayed.ROW_CLASS} browse-arrows" align="center" valign="middle" width="150"><a href="#top">{L_BACK_TO_TOP}</a> <a href="#bottom">{L_GOTO_DOWN}</a></td>
      <td class="{postrow.displayed.ROW_CLASS} messaging" valign="bottom" nowrap="nowrap" width="100%" height="28">
         <table width="18" border="0" cellspacing="0" cellpadding="0" height="18">
            <tr>
               <td valign="middle" nowrap="nowrap">
               {postrow.displayed.PROFILE_IMG} {postrow.displayed.PM_IMG} {postrow.displayed.EMAIL_IMG} {postrow.displayed.WWW_IMG} {postrow.displayed.AIM_IMG} {postrow.displayed.YIM_IMG} {postrow.displayed.MSN_IMG} {postrow.displayed.SKYPE_IMG} {postrow.displayed.ONLINE_IMG}
               <script type="text/javascript" language="JavaScript"><!--
               if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 ) {
                  document.write('{postrow.displayed.ICQ_IMG}');
               } else {
                  document.write('</td><td>&nbsp;</td><td valign=&quot;top&quot; nowrap=&quot;nowrap&quot;><div style=&quot;position:relative&quot;><div style=&quot;position:absolute&quot;>{postrow.displayed.ICQ_IMG}</div><div style=&quot;position:absolute;left:3px;top:-1px&quot;>{postrow.displayed.ICQ_STATUS_IMG}</div></div>');
               }
               //-->
               </script>
               <noscript>{postrow.displayed.ICQ_IMG}</noscript>
               </td>
            </tr>
         </table>
      </td>
   </tr>
<tr>
   <th class="thHead" colspan="2" nowrap="nowrap" height="3"><div align="right">Post #</div></th>
</tr>
   <!-- END displayed -->
   <!-- BEGIN hidden -->
   <tr>
      <td class="postdetails {postrow.hidden.ROW_CLASS}" colspan="2" align="center">{postrow.hidden.MESSAGE}</td>
   </tr>
   <!-- END hidden -->
<!-- END postrow -->
<!-- BEGIN no_post -->
<tr align="center">
<td class="row1" colspan="2" height="28">
   <span class="genmed">{no_post.L_NO_POST}</span>
</td>
</tr>
<!-- END no_post -->
<tr align="right">
<td class="catBottom" colspan="2" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td width="9%"></td>
<td align="center" nowrap="nowrap"><a name="bottomtitle"></a><h1 class="cattitle">{TOPIC_TITLE}</h1></td>
<td align="right" nowrap="nowrap" width="9%"><a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a> <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a> <a href="#top">{L_BACK_TO_TOP}</a> </td>
</table>
</td>
</tr>
</table>

<table class="forumline noprint" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td class="row2" valign="top" {COLSPAN_PAGINATION} width="150"><span class="gensmall">{PAGE_NUMBER}</span></td>
<!-- BEGIN topicpagination -->
<td class="row1" align="right" valign="top"><span class="gensmall">{PAGINATION}</span></td>
<!-- END topicpagination -->
</tr>
<!-- BEGIN switch_user_logged_in -->
<!-- BEGIN watchtopic -->
<tr>
<td class="row2" colspan="2" align="right" valign="top"><span class="gensmall">{S_WATCH_TOPIC}</span></td>
</tr>
<!-- END watchtopic -->
<!-- END switch_user_logged_in -->
<tr>
<td class="row2" colspan="2" align="center" style="padding:0px">
<!-- BEGIN switch_user_logged_in -->
<a name="quickreply"></a>
{QUICK_REPLY_FORM}<br />
<!-- END switch_user_logged_in -->


</td>
</tr>
<tbody id="info_open" style="display:''">
<!-- BEGIN show_permissions -->
<tr>
<td class="row2" valign="top" width="25%"><span class="gensmall">{L_TABS_PERMISSIONS}</span></td>
<td class="row1" valign="top" width="75%"><span class="gensmall">{S_AUTH_LIST}</span></td>
</tr>
<!-- END show_permissions -->
<tr>
<td class="catBottom" colspan="2" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" width="100%"><span class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_SEP}<a class="nav" href="{U_ALBUM}">{L_ALBUM}</a>{NAV_CAT_DESC_SECOND}</span></td>
<!-- BEGIN show_permissions -->
<td align="right" valign="middle"><span class="gensmall"><a href="javascript:ShowHideLayer('info_open','info_close');"><img src="{TABS_LESS_IMG}" alt="-" align="middle" border="0"></a></span></td>
<!-- END show_permissions -->
</tr>
</table>
</td>
</tr>
</tbody>
<tbody id="info_close" style="display:none">
<tr>
<td class="catBottom" colspan="2" height="28">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" width="100%"><span class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_SEP}<a class="nav" href="{U_ALBUM}">{L_ALBUM}</a>{NAV_CAT_DESC_SECOND}</span></td>
<td align="right" valign="middle"><span class="gensmall"><a href="javascript:ShowHideLayer('info_open','info_close');"><img src="{TABS_MORE_IMG}" alt="+" align="middle" border="0"></a></span></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>


<table class="noprint" width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<form action="{S_JUMPBOX_ACTION}" method="get" name="jumpbox" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<td align="left" valign="middle" nowrap="nowrap" {WIDTH_GALLERY}><span class="nav">
<!-- BEGIN switch_user_authpost -->
<a href="{U_POST_NEW_TOPIC}" rel="nofollow"><img src="{POST_IMG}" id="{POST_IMG_ID}" alt="{L_POST_NEW_TOPIC}" align="middle" border="0"></a> 
<!-- END switch_user_authpost -->
<!-- BEGIN switch_user_authreply -->
<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" id="i_reply" alt="{L_POST_REPLY_TOPIC}" align="middle" border="0"></a>
<!-- END switch_user_authreply -->
</span>
</td>
<!-- BEGIN viewtopic_bottom -->
<td align="right" nowrap="nowrap"><span class="gensmall">{L_JUMP_TO}: {S_JUMPBOX_SELECT} <input class="liteoption" type="submit" value="{L_GO}"></span></td>
<!-- END viewtopic_bottom -->
<!-- BEGIN moderation_panel -->
<td align="center">
<span class="gensmall">{moderation_panel.U_YOUR_PERSONAL_MODERATE}</span>
</td>
<td align="center" width="250">
<span class="gensmall"> </span>
</td>
<!-- END moderation_panel -->
</form>
</tr>
<!-- BEGIN viewtopic_bottom -->
<tr>
<td colspan="2" align="left" valign="top" nowrap="nowrap"><br>{S_TOPIC_ADMIN}<br />
<form name="action" method="get" action="{S_FORM_MOD_ACTION}">
<input type="hidden" name="t" value="{TOPIC_ID}" />
<input type="hidden" name="sid" value="{S_SID}" />
<span class="gen">{L_MOD_TOOLS}<br />{S_SELECT_MOD} <input class="liteoption" type="submit" value="{L_GO}"></span>
</form>
</td>
</tr>
<!-- END viewtopic_bottom -->
</table>

LUDAKLUDI
LUDAKLUDI
Forumember

Male Posts : 280
Reputation : 3
Language : English,Serbian
Location : Serbia-Belgrade

Back to top Go down

PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter .. Empty Re: PHP Templates -> General -> viewtopic_body ... is there any1 who know very good php to add post counter ..

Post by Guest September 6th 2008, 8:57 pm

Now from what i remember about this subject,

You need javascript for this to count what post it is, add the number and to detect deletion and addition of posts so it would have to be something along the lines of

Code:
<!--
var agt = navigator.userAgent.toLowerCase();
var originalFirstChild;
var display = false;

function createPagination(which, string, x, y)
{
   if ( display == true )
   {
      destroyPagination();
      display = false;
   }
   else
   {
      display = true;

      if (typeof(originalFirstChild) == 'undefined')
      {
         originalFirstChild = document.body.firstChild;
      }

      x = document.all ? (event.clientX + document.body.scrollLeft) : x;
      y = document.all ? (event.clientY + document.body.scrollTop) : y;

      element = document.createElement('div');
      element.style.position = 'absolute';
      element.style.zIndex = 1000;
      element.style.visibility = 'hidden';
      excessWidth = 0;

      excessHeight = 20;
      element.innerHTML = '<table cellspacing="0" cellpadding="0" border="0" style="width:auto;"><tr><td><span class="gen">' + string + '</span></td></tr></table>';
      renderedElement = document.body.insertBefore(element, document.body.firstChild);
      renderedWidth = renderedElement.offsetWidth;
      renderedHeight = renderedElement.offsetHeight;

      overFlowX = x + renderedWidth + excessWidth - document.body.offsetWidth;
      x = overFlowX > 0 ? x - overFlowX : x;

      overFlowY = y + renderedHeight + excessHeight - window.innerHeight - window.pageYOffset;
      y = overFlowY > 0 ? y - overFlowY : y;

      renderedElement.style.top = (y + 15) + 'px';
      renderedElement.style.left = (x + 15) + 'px';

      if (agt.indexOf('gecko') != -1 && agt.indexOf('win') != -1)
      {
         setTimeout("renderedElement.style.visibility = 'visible'", 1);
      }
      else
      {
         renderedElement.style.visibility = 'visible';
      }
   }
}

function Pagination()
{
}

function do_pagination_start()
{
   var start = document.go_page.start.value;
   start = (start > 2) ? 2 : start;
   start = (start - 1) * 15;
   start = (isNaN(start) || start < 0 ) ? 0 : start;

self.location.href='/forum_link-'+start+'.htm';

}

function destroyPagination()
{
   if (document.body.firstChild != originalFirstChild)
   {
      document.body.removeChild(document.body.firstChild);
   }
}
// -->

Not sure that will work though as it may need more work

In additional versions of forumotion forums this is a standard feature

Currently i am using Punbb and this comes as standard

Regards







Craig
avatar
Guest
Guest


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum