TinyPortal

Development => Support => Topic started by: bd2003 on December 17, 2005, 01:23:31 PM

Title: Articles not displaying?
Post by: bd2003 on December 17, 2005, 01:23:31 PM
I'm probably just not understanding something really simple, but I can't get an article to display?

Have two user-submitted articles (one is just a "test" by me), and trying to display either one, whether it's using the menu manager or by a direct link to the article results in blank space where the article should appear. Also, there's a link at the top showing "Page 1  2", and if you click on the "2" it sends you back to the home page?

Like I said, probably something really stupid I'm doing.

Running 1.1RC1, TP0.75 and TP_Oxygen (though the problem is the same when using Default)...

Here's a link to the article so you can see what I'm talking about:
http://www.mvohio.net/index.php?page=5

If anyone can give me a push in the right direction on this, I'd appreciate it...
Thanks!
Title: Re: Articles not displaying?
Post by: IchBin on December 17, 2005, 07:50:05 PM
Have you tried creating the article with the editor off? You can turn it off in your TPAdmin settings.
Title: Re: Articles not displaying?
Post by: bloc on December 18, 2005, 12:36:41 AM
Also..have you "approved" the submitted articles?
Title: Re: Articles not displaying?
Post by: bd2003 on December 18, 2005, 04:08:56 AM
Yep and yep...

I just tried creating one myself, and same thing: a two page link, but blank first page and link to page 2 send me back to home page... the breadcrumb at the top of the page actually shows the article title, though..?

Title: Re: Articles not displaying?
Post by: bloc on December 18, 2005, 10:55:55 AM
If you create a third article, does it show?

Also...when editing the articles, they do have content?
Title: Re: Articles not displaying?
Post by: bd2003 on December 18, 2005, 01:57:42 PM
Nope... still doesn't show...

And yep - if I go to edit the articles, the content is all there....

Kinda glad I got you all stumped on this one too - makes me feel less like an idiot (even tho I still think it's something stupid I've done)...
:)
Title: Re: Articles not displaying?
Post by: bloc on December 18, 2005, 07:51:23 PM
It could be something with the counting routine in TP...are you using the latest files there?
Title: Re: Articles not displaying?
Post by: bd2003 on December 19, 2005, 02:25:36 PM
As far as I know... I downloaded and installed the TP files only archive (after a bad package manager install)... could I have missed one?

I'll have to double check...
Title: Re: Articles not displaying?
Post by: bd2003 on December 20, 2005, 10:34:19 PM
I checked, double-checked, and re-uploaded just to be on the safe side - but no articles...

Anyone have any more ideas? I can go thru the code line by line if I have to, but would rather not... :)

And please - don't put it past being operator error, either! I'm ready to try anything at this point...
Title: Re: Articles not displaying?
Post by: bloc on December 21, 2005, 11:57:55 AM
I can take a look..but I need to ask for a temporary admin account to look at the TPadmin section. I am not sure..but it might be a bug in TP - or a wrong database record.
Title: Re: Articles not displaying?
Post by: bd2003 on December 21, 2005, 12:07:15 PM
No problem - I'll PM you the access... thanks, Bloc! I appreciate it....

I just know this is something stupid..
*sigh*
Title: Re: Articles not displaying?
Post by: bd2003 on December 22, 2005, 06:45:45 PM
Think I may have stumbled across somthing...

In TPORTAL.PHP, this code is at line 328:


  if($row['useintro'] == -1)
  $phplink = '-1';
  elseif($row['useintro'] != -1 && $mypage!=''){
  $phplink = '0';
  else
   $phplink = $row['useintro'];
     $bt[] = array(


userintro = 1
mypage = 5

It's catching on the ELSEIF" - which keeps the bt array from being populated... and the bt array is what's displayed on the page...

Am I gettin' close?
Title: Re: Articles not displaying?
Post by: bloc on December 22, 2005, 08:36:27 PM
mm..not quite. I am using the "useintro" for a check...if its "-1" then its a php article, and that can't use a intro. $bt is filled anyway.
Title: Re: Articles not displaying?
Post by: bd2003 on December 22, 2005, 09:41:53 PM
Hmm... looked down in the merge (just below), and couldn't get anything to echo out of $t either...

I gotta scoot right now, but will look at it some more this evening...
Title: Re: Articles not displaying?
Post by: bd2003 on December 23, 2005, 04:01:39 AM
Quote from: Bloc on December 22, 2005, 08:36:27 PM
mm..not quite. I am using the "useintro" for a check...if its "-1" then its a php article, and that can't use a intro. $bt is filled anyway.

Duh. I see what you mean now - I was lumping everything together.  I can see where it's getting populated now.

Sorry 'bout that....


Update: Verified that it's leaving TPortal_init with $context['TPortal']['boardnews'] fully loaded... now to track down where that's going...

Maybe some sleep first, tho...
Title: Re: Articles not displaying?
Post by: bd2003 on December 23, 2005, 07:41:11 PM
Quick (and probably easy) PHP question...

With:
$context['TPortal']['boardnews'] - 1
$counter - 1
$context['TPortal']['mystart'] - 0
$context['TPortal']['frontpage_limit'] - 1
,

will $show ever be set to true in the following code?

foreach($context['TPortal']['boardnews'] as $news){
// reached the start yet?
$show=false;

if($counter > $context['TPortal']['mystart'] || $counter == $context['TPortal']['mystart']){
if($counter< ($context['TPortal']['mystart']+$context['TPortal']['frontpage_limit']))
$show=true;
}
$counter++;
}


I don't see how it could be, but....
Title: Re: Articles not displaying?
Post by: bd2003 on December 26, 2005, 02:13:53 PM
Okay, I've answered my own question (I think). I don't believe that the "$show" variable will ever be set to true under these conditions...

Since $mystart was always at 0, I tried commenting the nested IF condition that set $show to true, and voila! I now have articles appearing...

Not sure why $mystart isn't allowing this to work properly, though... I'll dig in the code to see what exactly it's being used for...
Title: Re: Articles not displaying?
Post by: bloc on December 26, 2005, 07:41:04 PM
I have been meaning to rewrite this for some time, its not optimal and may even give wrong results.
Title: Re: Articles not displaying?
Post by: bd2003 on December 27, 2005, 02:12:54 PM
So I didn't break it??

Yay!!
;)
Title: Re: Articles not displaying?
Post by: MGT_STC007 on December 28, 2005, 01:53:09 AM
Funny thing this is exactly one of the issues I am haveing right now on my forum.  Thought it was just me!  I also have other issues like post icons not showing up just appears as text and not being able to post links of any kind without them becoming distorted and broken.

I'll gladly grant you access to mine Bloc.
Title: Re: Articles not displaying?
Post by: bloc on December 28, 2005, 01:20:21 PM
Thanks. I am testing and sorting this out now, so when I am done I like to test it out. :)
Title: Re: Articles not displaying?
Post by: bd2003 on December 28, 2005, 03:33:11 PM
Bloc, you want the admin access back at my site? No prob if it'll help you out....
:)