TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 790
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 644
  • Total: 645
  • tino

switching between articles

Started by barnic, April 15, 2008, 02:24:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

barnic

I've a 5 articles in the same category.
when I open one of these, in the bottom there are links to go at previous or next article
but this links doesn't work fine
the previous link point always a the first article and next links point always to the second

anybody have the same problem?

could you help me please?

thanks
Nicola


G6Cad

Can you please read the posting guide and fill in the proper lines that wee need in order to help you any further ?

barnic

sorry
my english is very poor.....

I did not understand what you are trying to tell me.
I explained evil or wrong place where I send my question?

sorry....again

Ken.

Nicola, the topic G6 is asking you to read and follow is linked below, please do as directed in that topic so that we are better able to help you.

http://www.tinyportal.net/index.php?topic=581.0
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

barnic

I will try.
You could be more explicit about what is wrong with my message, I said that my English is very bad ..... thanks anyway

Ken.

Including the information that you'll find at the bottom of the Posting Guide would be a good place to start.



[b]Link to my site:[b] http://www.yourdomain.com
[b]SMF version:[/b] SMF ver. here
[b]TP version:[/b] TP ver. here
[b]Theme name and version:[/b] Theme name here
[b]Mods installed:[/b] Mods listed here
[b]Related Error messages:[/b] Error message here
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

barnic

#6
Link to my site: It's an INTRANET
SMF version: SMF 1.1.4
TP version: TP 1.0.5 beta
Theme name and version: SMF Default
Mods installed:
Active Members In Topic 1.5   
Admins Can Post As Alternative User 1.0   
Advanced Visual Verification 1.2   
Ad Managment 2.3   
Avatar on Member List 1.0   
Bookmarks 1.1   
Enhanced Calendar 1.1   
Custom Board Sort 1.0.1   
Enhanced Forum Statistics 1.0   
Enhanced User Statistics 1.0   
Highlight Search Keywords 1.0   
SMF Links 1.6.5   
Member Color Link 2.0.5   
MessagePreviewOnHover 1.5   
No Spam by Guests! 0.2
Page Number 2.0   
SMF Staff Page 1.5.1   
SMF 1.1.4 Search "brd" Bug Fix (1.0.1) 1.0.1   
Registration - Show Gender mod 1.0.0   
Spam Black List 0.2.1   
Spiders Don't Increase Topic Views 1.1   
Todays Birthday 0.1   
TinyPortal 1.052 
User Control Panel By Alan S 2.0   
Who Voted What? 1.1.3

Related Error messages:

I have 6 articles in a category.
When I see one of these articles, links at the bottom should be linked to the previous and next article.
Instead, they are always connected to the first and second article.

Is this a bug or it's a my own problem?

thaks
Nicola

p.s.
In the attached image, you can see what I talking about.


csury

#8
Quote from: Nicola Bardelli on April 21, 2008, 12:44:24 PM
nobody???

I'll bite.

I came across the same issue tonight, and managed to come up with a solution.

Look in file TPSubs.php in your sources directory, starting somewhere around line 463 or so.   My changes to the code in that area are noted by comments in the following code segment.   My coding isn't particularly elegant, but it seems to work.

// render it
if($display == 'list')
echo $render;
else
{
echo '<hr>';        // I wanted my stuff below an H-rule and centered on panel
echo '<center>';

$art=array(); $i=0; $curr=0;
foreach($articles as $rt)
{
$art[$i]='<a href="' . $rt['href']. '">'.$rt['subject'].'</a>';
// if($rt['selected']) //  Removed this line
if ($rt['subject'] == $current)    // My replacement for removed line
$curr=$i;
$i++;
}
if($curr>0)
$art_previous=$art[$curr-1];
else
$art_previous=$art[0];

if($curr<$i-1)
$art_next=$art[$curr+1];
else
$art_next=$art[$i];

// modified following block so preceding page link is not displayed when already showing the first page in category
echo '
<form name="articlejump" id="articlejump" action="#">
« ';     
if ($curr > 0)
echo $art_previous;
echo '&nbsp;&nbsp;' , '
<select name="articlejump_menu" onchange="javascript:location=document.articlejump.articlejump_menu.options[document.articlejump.articlejump_menu.selectedIndex].value;">';

        //  reinitialize loop counter to zero
$i = 0;       

foreach($articles as $art)
{
// Removed next line
// echo '<option value="' . $art['href']. '"' , $art['selected'] ? ' selected="selected"' : '' , '>'.$art['subject'].'</option>';

        // Added the following block
echo '<option value="' . $art['href']. ' ';
if ($i == $curr)
echo '" selected="selected"';
else
echo '';
echo '">'.$art['subject'].'</option>';
$i++;
}
// End of my block addition

echo '
</select>  &nbsp;
' . $art_next . ' »
</form></center>';


Edit - modified code a bit more to clean up "first in category" display.
Edit - fixed the IE 7 glitch.

csury

#9
Bummer.  The above seems to work just fine when on Firefox, but has a bit of a glitch when used on IE 7.

This website is proudly hosted on Crocweb Cloud Website Hosting.