TinyPortal

Development => Support => Topic started by: barnic on April 15, 2008, 02:24:40 PM

Title: switching between articles
Post by: barnic on April 15, 2008, 02:24:40 PM
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

Title: Re: switching between articles
Post by: G6Cad on April 15, 2008, 02:49:15 PM
Can you please read the posting guide and fill in the proper lines that wee need in order to help you any further ?
Title: Re: switching between articles
Post by: barnic on April 15, 2008, 02:59:06 PM
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
Title: Re: switching between articles
Post by: Ken. on April 15, 2008, 03:08:12 PM
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
Title: Re: switching between articles
Post by: barnic on April 15, 2008, 03:31:25 PM
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
Title: Re: switching between articles
Post by: Ken. on April 15, 2008, 03:40:04 PM
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
Title: links between articles
Post by: barnic on April 15, 2008, 03:59:41 PM
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.
Title: Re: switching between articles
Post by: barnic on April 21, 2008, 12:44:24 PM
nobody???
Title: Re: switching between articles
Post by: csury on April 23, 2008, 06:21:09 AM
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.
Title: Re: switching between articles
Post by: csury on April 23, 2008, 07:13:34 AM
Bummer.  The above seems to work just fine when on Firefox, but has a bit of a glitch when used on IE 7.
Title: Re: switching between articles
Post by: csury on April 23, 2008, 07:50:24 AM
Fixed it - seems to work fine on IE7 and Firefox.
Title: Re: switching between articles
Post by: barnic on April 23, 2008, 08:01:12 AM
thankyou very much!!!!  ;D ;D ;D


I will only give you a hint.
Instead of using "«" use "«"
Instead of using "»" use "»"

otherwise instead of arrows you'll see a square in some cases  ;)

you can mark this change to an administrator, I believe it is something useful for all
Title: Re: switching between articles
Post by: Lafemme on October 25, 2008, 10:24:35 AM
oke.. i run 1.0.6 and also having this problem.. see attached..

can i also use the solution that was given on the previous page?