PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Fri Mar 23, 2007 1:35 pm Reply with quote Back to top

This isn't a problem on ravenphpscripts.com, but I'm having issues with the Home Page ReadMore link. With very short articles, one line for example, that darn ReadMore link is ubiquitous across three domains. I thought it was themes, but the issue is in both fisubice and deepblue. Is it just me or do others have a misbehaving ReadMore link?
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Fri Mar 23, 2007 1:44 pm Reply with quote Back to top

Hmmm...I do not with RN2.10 but I have a custom theme. It may be a function of your theme. Maybe check the themeindex() function in theme.php.
View user's profile Send private message
jakec
Moderator


Joined: Feb 06, 2006
Posts: 1712
Location: United Kingdom

PostPosted: Sat Mar 24, 2007 6:16 am Reply with quote Back to top

I must admit I have found this on some of my sites that I have upgraded and I am using fisubice. I haven't been able to work out what is causing it. Confused
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Sat Mar 24, 2007 9:14 am Reply with quote Back to top

That is definitely odd. I have upgraded three sites now and have not seen this. CodyG, is it doing this on EVERY article? If not, check the database directly to see if there is anything in the extended text field there, even if it is a blank space (not NULL).
View user's profile Send private message Visit poster's website
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Sat Mar 24, 2007 9:41 am Reply with quote Back to top

it's got to be in my old theme files ... time to do a bit more upgrading. Wink
View user's profile Send private message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Sat Mar 24, 2007 11:31 am Reply with quote Back to top

later ... although my original deepblue theme.php is ugly compared to the RN deepblue theme.php, the ReadMore ubiquitous link is still a problem with new RN 2.1 DeepBlue and fibsubice themes.

Code:

FormatStory($thetext, $notes, $aid, $informant);
    echo
                                                '</td>
                                            </tr>
                                        </table>'."\n"
                                    .'</td>
                                </tr>
                            </table><br />'."\n"
                        .'</td>
                    </tr>
                    <tr>
                        <td bgcolor="#FFFFFF" align="center">'."\n"
                            .'<font class="tiny">'._POSTEDBY.' ';
                            formatAidHeader($aid);
                        echo ' '._ON.' '. $time .'('.$counter .' '._READS.')<br /></font>'."\n"
                            .'<font class="content">'.$morelink.'</font>'."\n"
    .'<img src="themes/DeepBlue/images/pixel.gif" border="0" height="2" alt="" />'."\n"
                        .'</td>
                    </tr></table>'."\n"
                .'</td>
            </tr>
        </table><br />'."\n";
}


Where is the $morelink defined? Maybe something there?
View user's profile Send private message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Sat Mar 24, 2007 11:37 am Reply with quote Back to top

yes, every article, montego.
in bodytext column Null is No and default is empty and the field is empty too.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sat Mar 24, 2007 12:36 pm Reply with quote Back to top

In modules/News/index.php there is this:

Code:

        if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {
            $morelink .= "$story_link".'<b>'._READMORE.'</b></a> | ';
        } else {
            $morelink .= '';
        }


So it looks like you get Read More if
$fullcount > 0 - if you have any body text this will be true
$c_count > 0 - number of comments in the story table for this article
$articlecomm == 0 - this I don't get; this is from your config table (mine is 1)
$acomm == 1; this is from the story table (all my stories have this set at 0)
View user's profile Send private message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Sat Mar 24, 2007 1:53 pm Reply with quote Back to top

I've turned article comments off... $articlecomm

brilliant gremmie ...

I turned comments back on and the ubiquitous ReadMore goes away.
Can you confirm this Jakec?

How is this connected and how do I fix it? Can I take out the reference to $articlecomm in the if statement?
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sat Mar 24, 2007 2:09 pm Reply with quote Back to top

It seems to me that maybe that if statement has a bug.

Maybe it should be:

Code:

        if (($fullcount > 0) || ($c_count > 0 && ($articlecomm == 1 || $acomm == 1))) {
            $morelink .= "$story_link".'<b>'._READMORE.'</b></a> | ';
        } else {
            $morelink .= '';
        }


I'm assuming that $articlecomm == 1 means the admin has globally allowed comments, and I'm also assuming that $acomm is a way to let individual stories have comments, overriding the global setting.

So with that reworked, you get the Read More if you either have body text OR (you have any comments and comments are allowed globally or for that one story). Question
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sat Mar 24, 2007 2:48 pm Reply with quote Back to top

The questionable if statement is in modules/News/index.php where $morelink is computed.

It is apparently just displayed in themeindex(), so I was wrong about it being a theme issue.
View user's profile Send private message
jakec
Moderator


Joined: Feb 06, 2006
Posts: 1712
Location: United Kingdom

PostPosted: Sat Mar 24, 2007 2:53 pm Reply with quote Back to top

CodyG wrote:
Can you confirm this Jakec?


Yes, Gremmie has hit the nail on the head!

Gremmie you are a genius. Wink
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Sat Mar 24, 2007 7:05 pm Reply with quote Back to top

But it does not explain why we are not seeing that on RavenNuke.com, nor any of my three sites?? Maybe I am missing something here, but this has always worked right for me. Confused
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sat Mar 24, 2007 9:32 pm Reply with quote Back to top

When you turn off comments on articles in preferences you get a "Read more" link even when there isn't any more to read. I've always had comments on so I never noticed this bug.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Sun Mar 25, 2007 8:46 am Reply with quote Back to top

Thank you for helping me understand the issue, Gremmie. I do not have alot of time most days and cannot always dig deep.

If you feel that the above is the final tested solution, I will make it so in our repository so that any future patch release will have this fixed. In addition, a clear and concise explanation of the issue and the fix should be added to the RN Bug Fixes forum (Staff Only) in case others wish to make the fix.

BTW, I also thank you for changing your last post text. Wink
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sun Mar 25, 2007 9:52 am Reply with quote Back to top

Let me look at it some more; I didn't test that code and I'm not sure what the acomm field is really for (it doesn't seem to be set anywhere).

As far as changing my text... Embarassed sometimes I am in a hurry to respond and give a less than helpful answer.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Sun Mar 25, 2007 11:00 am Reply with quote Back to top

Ok...$articlecomm is a 1 when the admin has globally allowed comments for articles in the admin panel/preferences. $acomm controls comments on a per-story basis. When you submit a new story, you get the choice to activate/deactive comments for that story. $acomm is that flag. However, CONFUSINGLY, a value of 1 for acomm means comments are DISABLED. Mad

Here is my whole fix. All of the changes are in modules/News/index.php:

Find:
Code:


        if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {
            $morelink .= "$story_link".'<b>'._READMORE.'</b></a> | ';
        } else {
            $morelink .= '';
        }


Change that to this:

Code:

        if ($fullcount > 0 || ($c_count > 0 && $articlecomm == 1 && $acomm == 0)) {
            $morelink .= "$story_link".'<b>'._READMORE.'</b></a> | ';
        } else {
            $morelink .= '';
        }


And finally, and I'm not proud of this, but there is already precedence. The existing code is so hacked up it is hard to fix correctly. There is an issue with the vertical bars. When you have disabled comments (either globally or locally), and you have a short article with no extra text, the read more link gets displayed like this: "( | Score: 0)".

To "fix" this Embarassed find:

Code:

        $morelink = str_replace(' |  | ', ' | ', $morelink);


After that, add

Code:

        $morelink = str_replace('( | ', '(', $morelink);


Again, I'm not proud of that, but someone already realized their logic was horked up and began patching it after the fact instead of fixing the root cause. I'll just pile on otherwise the number of changes would be too great to post here.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7330
Location: Arizona

PostPosted: Mon Mar 26, 2007 6:26 am Reply with quote Back to top

Gremmie, thank you for this! I am adding notes to our bug tracker pointing to each final fix. Once you are comfortable with the results, I'll incorporate into the project code and start running it through some test cycles.

Thanks again for the help on this!

BTW, I can honestly say that I touched that line of code last in RavenNuke(tm), but it was for the mass conversion of double-quotes to single-quotes. Whew!!!! Smile So, that was either FB's mess (my bet) or the patch series.
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Mon Mar 26, 2007 7:18 am Reply with quote Back to top

montego, that same broken logic exists in 7.9.

I tested it through every combination I could think of (global comments on/off, and I created test stories with comments on and off, some with body text and some without). So I'm happy with the above changes. Someone else can certainly double check it.
View user's profile Send private message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Mon Mar 26, 2007 7:40 am Reply with quote Back to top

What about News/categories.php?
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Mon Mar 26, 2007 10:50 am Reply with quote Back to top

CodyG wrote:
What about News/categories.php?


Hi Cody, what is the issue with that file? I haven't looked at it.
View user's profile Send private message
CodyG
PHP-Portal Project


Joined: Jan 02, 2003
Posts: 580
Location: Vancouver Island

PostPosted: Mon Mar 26, 2007 11:51 am Reply with quote Back to top

It's the same issue as the index.php file.... when viewing the story via categories, the readmore link becomes ubiquitous.
iow, the same code is in the categories.php file

just thought you all might like to know... Wink
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Mon Mar 26, 2007 12:00 pm Reply with quote Back to top

Ah, okay, I'll check that out. Too bad the code wasn't reused for that function. Too much copy & paste going on in the code base for my tastes.
View user's profile Send private message
fkelly
Moderator


Joined: Aug 30, 2005
Posts: 2086
Location: near Albany NY

PostPosted: Mon Mar 26, 2007 2:25 pm Reply with quote Back to top

Quote:
Too much copy & paste going on in the code base for my tastes.


LOL, right on Gremmie!! This is a ubiquitous and insidious problem with the themes particularly and one we really should address for the next release. I will write something up soon.
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2401
Location: Iowa, USA

PostPosted: Mon Mar 26, 2007 5:33 pm Reply with quote Back to top

CodyG, forgive me but how do you view stories via categories? What do you click on to make it do that? I'm not sure I've ever used that feature of Nuke. LOL.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0