Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 

The free forums are now under new ownership, a full announcement will be made shortly

       myfreeforum.org Forum Index -> Portal components
danm97

GOTO page, amount of pages

PLEASE ENTER THE FOLLOWING>>>>


Enter your myff forum url here, if the issue is on a particular part of the forum, then give a link to where the problem actually is. Do not enter your own domain name it must be the actual myff link :

http://freeforallpoker.myfunforum.org/index.php

Please indicate keywords you have searched on:
go to page, goto, pagination

Now ask your question in clear English without "txt" speak>>>>

Ok I'm trying to create a new portal for a new board style which the index would be the 50 last topics being posted.

The problem is the {topics_forumtopics.GOTO_PAGE} doesnt work properly...
The amount of pages showing isnt right, If I set show 15 topics in the portal I created the number of pages is right but if I set with higher amount of topics shown and it show less number of pages.

You see anything I could have done wrong ??

Spoiler:

Code:

<form method="post" action="{S_POST_DAYS_ACTION}" style="display: inline;">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" align="center">
<!-- BEGIN switch_forumtopics_title -->

   <tr>
     <th  colspan="2" align="center" height="25" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
     <th width="100" align="center" nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th>
     <th width="50" align="center" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
     <th width="50" align="center" nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
     <th align="center" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
          <th width="75" align="center" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>
    
</tr>
<!-- END switch_forumtopics_title -->
   <!-- BEGIN switch_xs_enabled -->
<?php
if(empty($xs_tmp_topics_forumtopics))
{
   $topics_forumtopics_count = ( isset($this->_tpldata['topics_forumtopics.']) ) ?  sizeof($this->_tpldata['topics_forumtopics.']) : 0;
   // check own posts
   global $userdata, $db;
   $topic_ids = array();
   $user_topics = array();
   if ($userdata['user_id'] != ANONYMOUS)
   {
      for ($topics_forumtopics_i = 0; $topics_forumtopics_i < $topics_forumtopics_count; $topics_forumtopics_i++)
      {
         $topics_forumtopics_item = &$this->_tpldata['topics_forumtopics.'][$topics_forumtopics_i];
         $topic_ids[] = $topics_forumtopics_item['TOPIC_ID'];
      }
      if (!empty($topic_ids))
      {
         // check the posts
         $s_topic_ids = implode(', ', $topic_ids);
         $sql = "SELECT DISTINCT topic_id FROM " . POSTS_TABLE . "
            WHERE topic_id IN ($s_topic_ids)
               AND poster_id = " . $userdata['user_id'];
         if ( ($result = $db->sql_query($sql)) )
         {
            while ($row = $db->sql_fetchrow($result))
            {
               $user_topics[$row['topic_id']] = true;
            }
         }
      }
   }
   // check for new posts and change folder for own posts
   for ($topics_forumtopics_i = 0; $topics_forumtopics_i < $topics_forumtopics_count; $topics_forumtopics_i++)
   {
      $topics_forumtopics_item = &$this->_tpldata['topics_forumtopics.'][$topics_forumtopics_i];
      $topics_forumtopics_item['XS_NEW'] = strpos($topicrow_item['TOPIC_FOLDER_IMG'], '_new') > 0 ? '_new' : '';
      $user_replied = isset($user_topics[$topics_forumtopics_item['TOPIC_ID']]);
      if($user_replied)
      {
         $topics_forumtopics_item['TOPIC_FOLDER_IMG'] = str_replace('.gif', '_own.gif', $topics_forumtopics_item['TOPIC_FOLDER_IMG']);
      }
   }
   $xs_tmp_topics_forumtopics = true;
}
?>
   <!-- END switch_xs_enabled -->
<!-- BEGIN topics_forumtopics -->
 <tr>



     <td class="row" width="25" align="center" valign="middle" width="21" style="padding: 1px;"><img src="{topics_forumtopics.TOPIC_FOLDER_IMG}" width="19" height="17" alt="{topics_forumtopics.L_TOPIC_FOLDER_ALT}" title="{topics_forumtopics.L_TOPIC_FOLDER_ALT}" /></td>

    <td class="row"><span class="gensmall8"><a href="{topics_forumtopics.U_LINK}" class="gensmall8">{topics_forumtopics.TOPIC_TITLE}</a></span><br /><span class="gensmall">{topics_forumtopics.GOTO_PAGE}</span></td>

          <td class="row" align="center" valign="middle"><span class="gensmall3">{topics_forumtopics.TOPIC_AUTHOR}</span></td>
     <td class="row" align="center" valign="middle"><span class="gensmall2">{topics_forumtopics.REPLIES}</span></td>
     <td class="row" align="center" valign="middle"><span class="gensmall3">{topics_forumtopics.VIEWS}</span></td>
     <td class="row" align="center" valign="middle" nowrap="nowrap"><span class="gensmall9">{topics_forumtopics.LAST_POST_TIME}<br />{topics_forumtopics.LAST_POST_AUTHOR} {topics_forumtopics.LAST_POST_IMG}</span></td>

<td class="row" align="center" valign="middle"><span class="gensmall3"><a href="{topics_forumtopics.U_VIEW_FORUM}" class="gensmall3">{topics_forumtopics.FORUM_NAME}</a></td>


  </tr>
<!-- END topics_forumtopics -->
<!-- BEGIN posts_forumtopics -->
  <tr>
   <td class="row1" colspan="1" height="28"><span class="topictitle"><a href="{posts_forumtopics.U_LINK"} class="topictitle" >{posts_forumtopics.TOPIC_TITLE}</a></span></td>
  </tr>
  <tr>
   <td valign="top" ><span class="postbody">{posts_forumtopics.MESSAGE}</span></td>
  </tr>
<!-- END posts_forumtopics -->


</table>




Thanks !!
danm97

Edited forgot my link
myff admin

I don't get this code at all, it is not compatible with our forums it contains php blocks and that is not supported.
danm97

Its based on the portal "LATEST", for latest post or latest topics.

Named it FORUMTOPICS

I created most of it til I struggled with the GOTO page

I found this topic about a similar problem on this forum..

http://forum.myfreeforum.org/about12823.html&highlight=goto

seems at the end her problem was solved
myff admin

Point still being that the code you are posting is not compatible because it tries to use php.
danm97

 I took all those codes from my viewforum template... kinda lost here..

Isnt the forums are php ?? this portal will be used on my forum, not web pages.

I got it working except the goto page on my myfu_freeforallpoker3 template editing with my editor.

Maybe I expressed mysefl wrong in my 1st post by saying new board style and index.

Am I right ??
myff admin

Sorry I'm lost

Is there a link where this is visible?

But as I say the whole premise is wrong. The code is basically not something that works.
Zudane

Where exactly are you placing this?

And the comment the Admin made means this... PHP is scripting that is run server side - the server chooses who or what can use it.  No user on MYFF can use PHP in any of their pages, because the access isn't given.

Everything here is PHP scripting:

Code:
<?php
...
?>


Where did you copy this from?  Was this copied from another MYFF portal, or from another site?
danm97

myff admin wrote:
Sorry I'm lost

Is there a link where this is visible?

But as I say the whole premise is wrong. The code is basically not something that works.


Ok to see it you would need to be logged in with the editor...I dont know if you can but anyway heres a pic of the result....

Spoiler:



Zudane wrote:
Where exactly are you placing this?

And the comment the Admin made means this... PHP is scripting that is run server side - the server chooses who or what can use it.  No user on MYFF can use PHP in any of their pages, because the access isn't given.

Everything here is PHP scripting:

Code:
<?php
...
?>


Where did you copy this from?  Was this copied from another MYFF portal, or from another site?


I put those codes in a latest topics portal "{MYFF.FORUMTOPICS}" and the I but the portal in my 3rd board style index_body.tpl

I copied most of it from my viewforum_body.tpl which is ...

Spoiler:

Code:
<table width="100%" cellspacing="1" cellpadding="4" border="0" align="center" class="nav">
<tr>
   <td class="nav" align="left" valign="middle"><span class="nav"><a href="http://freeforallpoker.net/index.php">FreeForAllPoker Forum Index</a> &raquo; <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
   <td class="nav navform" align="right" valign="middle" nowrap="nowrap"><span class="nav"><form action="{CA_SEARCH_INDEX}" method="post" style="display: inline;"><input type="hidden" name="show_results" value="topics" /><input type="hidden" name="search_forum" value="{CA_SEARCH_FORUM}" />
   <input type="text" name="search_keywords" class="post" size="15" />
   <input type="submit" value="{L_SEARCH}" class="mainoption" />
   </form></span></td>
</tr>
</table>
<br />

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <!-- Begin BidVertiser code -->
<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=290686&bid=711118" type="text/javascript"></SCRIPT>
<noscript><a href="http://www.bidvertiser.com">internet marketing</a></noscript>
<!-- End BidVertiser code -->  



   <td align="left" valign="middle" width="20%"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a></td>

</tr>
<tr>

   <td align="right" valign="bottom" nowrap="nowrap"><div class="pagination">{PAGINATION}</div></td>
</tr>
</table>

<form method="post" action="{S_POST_DAYS_ACTION}" style="display: inline;">
{TPL_HDR1}<a class="gensmall11" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>{TPL_HDR2}<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
     <th colspan="2" align="center" height="25" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
     <th width="100" align="center" nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th>
     <th width="50" align="center" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
     <th width="50" align="center" nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
     <th align="center" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
   </tr>
   <!-- BEGIN switch_xs_enabled -->
<?php
if(empty($xs_tmp_topicrow))
{
   $topicrow_count = ( isset($this->_tpldata['topicrow.']) ) ?  sizeof($this->_tpldata['topicrow.']) : 0;
   // check own posts
   global $userdata, $db;
   $topic_ids = array();
   $user_topics = array();
   if ($userdata['user_id'] != ANONYMOUS)
   {
      for ($topicrow_i = 0; $topicrow_i < $topicrow_count; $topicrow_i++)
      {
         $topicrow_item = &$this->_tpldata['topicrow.'][$topicrow_i];
         $topic_ids[] = $topicrow_item['TOPIC_ID'];
      }
      if (!empty($topic_ids))
      {
         // check the posts
         $s_topic_ids = implode(', ', $topic_ids);
         $sql = "SELECT DISTINCT topic_id FROM " . POSTS_TABLE . "
            WHERE topic_id IN ($s_topic_ids)
               AND poster_id = " . $userdata['user_id'];
         if ( ($result = $db->sql_query($sql)) )
         {
            while ($row = $db->sql_fetchrow($result))
            {
               $user_topics[$row['topic_id']] = true;
            }
         }
      }
   }
   // check for new posts and change folder for own posts
   for ($topicrow_i = 0; $topicrow_i < $topicrow_count; $topicrow_i++)
   {
      $topicrow_item = &$this->_tpldata['topicrow.'][$topicrow_i];
      $topicrow_item['XS_NEW'] = strpos($topicrow_item['TOPIC_FOLDER_IMG'], '_new') > 0 ? '_new' : '';
      $user_replied = isset($user_topics[$topicrow_item['TOPIC_ID']]);
      if($user_replied)
      {
         $topicrow_item['TOPIC_FOLDER_IMG'] = str_replace('.gif', '_own.gif', $topicrow_item['TOPIC_FOLDER_IMG']);
      }
   }
   $xs_tmp_topicrow = true;
}
?>
   <!-- END switch_xs_enabled -->
   <!-- BEGIN topicrow -->
   <tr>
     <td class="row" align="center" valign="middle" width="21" style="padding: 1px;"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="17" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
     <td class="row" width="100%"><span class="genmed">{topicrow.NEWEST_POST_IMG}</span><span class="topiclink{topicrow.XS_NEW}"><a class="topiclink{topicrow.XS_NEW}" href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
      <div class="gotopage">{topicrow.GOTO_PAGE}</div></span></td>
     <td class="row" align="center" valign="middle"><span class="gensmall3">{topicrow.TOPIC_AUTHOR}</span></td>
     <td class="row" align="center" valign="middle"><span class="gensmall2">{topicrow.REPLIES}</span></td>
     <td class="row" align="center" valign="middle"><span class="gensmall3">{topicrow.VIEWS}</span></td>
     <td class="row" align="center" valign="middle" nowrap="nowrap"><span class="gensmall9">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
   </tr>
   <!-- END topicrow -->
   <!-- BEGIN switch_no_topics -->
   <tr>
     <td class="row" colspan="6" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td>
   </tr>
   <!-- END switch_no_topics -->
   <tr>
     <td class="catBottom" align="right" valign="middle" colspan="6" height="25"><table width="100%" cellspacing="0" cellpadding="0" border="0">
     <tr>
      <td valign="middle" nowrap="nowrap"><span class="genmed" style="font-weight: bold;">&nbsp;{L_DISPLAY_TOPICS}:</span></td>
      <td valign="middle" nowrap="nowrap">&nbsp;{S_SELECT_TOPIC_DAYS}&nbsp;<input type="submit" class="mainoption" value="{L_GO}" name="submit" /></td>
      <td valign="middle" align="right" width="100%"><span class="genmed" style="font-weight: bold;">{S_TIMEZONE}&nbsp;</span></td>
     </tr></table></td>
   </tr>
</table>{TPL_FTR}
</form>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
   <td align="left" valign="top" nowrap="nowrap">
      <a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a><br /><br />
      <table cellspacing="2" cellpadding="0" border="0" class="forumline2">
         <tr>
            <td width="20" align="center"><img src="{FOLDER_NEW_IMG}" alt="{L_NEW_POSTS}" width="19" height="17" /></td>
            <td class="gensmall2">{L_NEW_POSTS}</td>
            <td>&nbsp;&nbsp;</td>
            <td width="20" align="center"><img src="{FOLDER_IMG}" alt="{L_NO_NEW_POSTS}" width="19" height="17" /></td>
            <td class="gensmall3">{L_NO_NEW_POSTS}</td>
            <td>&nbsp;&nbsp;</td>
         </tr>

         <tr>
            <td class="gensmall2" align="center"><img src="{FOLDER_HOT_NEW_IMG}" alt="{L_NEW_POSTS_TOPIC_HOT}" width="19" height="17" /></td>
            <td class="gensmall2">New posts [ Popular ]</td>
            <td>&nbsp;&nbsp;</td>
            <td class="gensmall2" align="center"><img src="{FOLDER_HOT_IMG}" alt="{L_NO_NEW_POSTS_TOPIC_HOT}" width="19" height="17" /></td>
            <td class="gensmall3">No new posts [ Popular ]</td>
            <td>&nbsp;&nbsp;</td>
         </tr>


         <tr>
            <td class="gensmall2" align="center"><img src="{FOLDER_LOCKED_NEW_IMG}" alt="{L_NEW_POSTS_TOPIC_LOCKED}" width="19" height="17" /></td>
            <td class="gensmall2">{L_NEW_POSTS_LOCKED}</td>
            <td>&nbsp;&nbsp;</td>
            <td class="gensmall2" align="center"><img src="{FOLDER_LOCKED_IMG}" alt="{L_NO_NEW_POSTS_TOPIC_LOCKED}" width="19" height="17" /></td>
            <td class="gensmall3">{L_NO_NEW_POSTS_LOCKED}</td>
            <td>&nbsp;&nbsp;</td>
         </tr>

         <tr>
            <td class="gensmall2" align="center"><img src="{FOLDER_STICKY_NEW_IMG}" alt="{L_NEW_POSTS_TOPIC_STICKY}" width="19" height="17" /></td>
            <td class="gensmall2">New posts [ Sticky ]</td>
            <td>&nbsp;&nbsp;</td>
            <td class="gensmall2" align="center"><img src="{FOLDER_STICKY_IMG}" alt="{L_NO_NEW_POSTS_TOPIC_STICKY}" width="19" height="17" /></td>
            <td class="gensmall3">No new posts [ Sticky ]</td>
            <td>&nbsp;&nbsp;</td>
         </tr>

         <tr>
            <td class="gensmall2" align="center"><img src="{FOLDER_ANNOUNCE_NEW_IMG}" alt="{L_NEW_POSTS_TOPIC_ANNOUNCE}" width="19" height="17" /></td>
            <td class="gensmall2">New posts [ Announcement ]</td>
            <td>&nbsp;&nbsp;</td>
            <td class="gensmall2" align="center"><img src="{FOLDER_ANNOUNCE_IMG}" alt="{L_NO_NEW_POSTS_TOPIC_ANNOUNCE}" width="19" height="17" /></td>
            <td class="gensmall3">No new posts [ Announcement ]</td>
            <td>&nbsp;&nbsp;</td>
         </tr>



      </table><br />
      {JUMPBOX}<br />
   </td>
   <td align="right" valign="top" nowrap="nowrap">
      <div class="pagination">{PAGINATION}</div><br />
      <span class="gensmall2">{S_AUTH_LIST}</span><br />
   </td>
</tr>
</table>



As you can see the php part is there and always been ... I never edited that part.

So if you tell me that those codes....

Spoiler:

Code:
<?php
if(empty($xs_tmp_topicrow))
{
   $topicrow_count = ( isset($this->_tpldata['topicrow.']) ) ?  sizeof($this->_tpldata['topicrow.']) : 0;
   // check own posts
   global $userdata, $db;
   $topic_ids = array();
   $user_topics = array();
   if ($userdata['user_id'] != ANONYMOUS)
   {
      for ($topicrow_i = 0; $topicrow_i < $topicrow_count; $topicrow_i++)
      {
         $topicrow_item = &$this->_tpldata['topicrow.'][$topicrow_i];
         $topic_ids[] = $topicrow_item['TOPIC_ID'];
      }
      if (!empty($topic_ids))
      {
         // check the posts
         $s_topic_ids = implode(', ', $topic_ids);
         $sql = "SELECT DISTINCT topic_id FROM " . POSTS_TABLE . "
            WHERE topic_id IN ($s_topic_ids)
               AND poster_id = " . $userdata['user_id'];
         if ( ($result = $db->sql_query($sql)) )
         {
            while ($row = $db->sql_fetchrow($result))
            {
               $user_topics[$row['topic_id']] = true;
            }
         }
      }
   }
   // check for new posts and change folder for own posts
   for ($topicrow_i = 0; $topicrow_i < $topicrow_count; $topicrow_i++)
   {
      $topicrow_item = &$this->_tpldata['topicrow.'][$topicrow_i];
      $topicrow_item['XS_NEW'] = strpos($topicrow_item['TOPIC_FOLDER_IMG'], '_new') > 0 ? '_new' : '';
      $user_replied = isset($user_topics[$topicrow_item['TOPIC_ID']]);
      if($user_replied)
      {
         $topicrow_item['TOPIC_FOLDER_IMG'] = str_replace('.gif', '_own.gif', $topicrow_item['TOPIC_FOLDER_IMG']);
      }
   }
   $xs_tmp_topicrow = true;
}
?>



Arent meant to be there just tell me I will remove it. But those codes are in the default template of Artemis.

I hope this is clear and its not too much work
danm97

Forgot to say the portal I created isnt the categories part...but the forum itself you can see under Freeforallpoker.net Forum

And to confirm my 1st question ...

If you look at the Prediction topic it show only 5 pages but we have about 13 pages in that topic.
myff admin

The explanation is not one you will guess.

But you are using FORUMTOPICS as a portal name, but this is the name of an existing loop macro.

So variable defined by the FORUMTOPICS portal appear under the forumtopics loop. e.g. GOTO_PAGE gets overwritten by the portals macros.
danm97

Ok thanks ... but just tried by changing the name for {MYFF.FORUMTOPIQ} and still the same

Any other ideas ??
myff admin

Perhaps a cache needs to clear to see the change?
danm97

myff admin wrote:
Perhaps a cache needs to clear to see the change?


Just did no success

reminder from my 1st post: The weird thing is that if I set this portal to show 15 topics the amount of pages is perfect but if I ask for more topics then the amount of pages is screwed... hope this help
myff admin

Fixed

It was a bug  

I'm afraid that I had not cottoned on to the fact that you had completely redone the index_page so I was looking for an issue with the portal breaking the index page, rather than it simply being a portal issue.

Your last post did make me twig
danm97

   

Its perfect now !!! Thanks a lot !! Great suport as usual !!

P.S.: Another reminder im french so I dont explain myself perfectly lol
But as always you succeed to help out !! Thanks again !!

       myfreeforum.org Forum Index -> Portal components
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum