Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes
Author Message
LCJ_Eric
New Member
New Member


Joined: Oct 26, 2005
Posts: 9

PostPosted: Thu Nov 16, 2006 9:10 pm Reply with quote

I am having a weird problem and can't seem to find where to fix it. Anytime a story is posted (through "submit news") it has two very annoying extra line breaks like this example:

    Eric writes "
    We will again be having our Rotary Lights Charity Ride...
    (body deleted to save space)
    See the post in the forum by clicking here for more details.
    "



There is the " on the first line and then a line break. There is also a line break at the end of all articles and a quote orphaned at the bottom. What I want it to look like is this:

    Eric writes
    "We will again be having our Rotary Lights Charity Ride...
    (body deleted to save space)
    See the post in the forum by clicking here for more details."


OR....
I would even be fine with getting rid of those quote marks completely.

Does anyone have any ideas on this? I am stumped!
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Thu Nov 16, 2006 11:24 pm Reply with quote

What theme are you using? You'd probably check the themeindex function in theme.php

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
LCJ_Eric
PostPosted: Fri Nov 17, 2006 11:01 am Reply with quote

I am using XPMidnight and fiapple211. Both exhibit the problem, but XPMidnight is the main theme used. There are two areas I believe that may hold the solution, but I am not sure which one holds the answer.

Here is the FormatStory section from theme.php for XPMidnight
Code:
function FormatStory($thetext, $notes, $aid, $informant) {

    global $anonymous;
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b> $notes>\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   echo "<font class=\"content\">$thetext$notes</font>\n";
    } else {
   if($informant != "") {
       $boxstuff = "<i><a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a></i> ";
   } else {
       $boxstuff = "$anonymous ";
   }
   $boxstuff .= "".translate("<i>writes</i>")." \"$thetext\"$notes\n"; echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";
    }
}
[/list]

Here is the functionThemeIndex section from theme.php for XPMidnight
[list]function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $datetime, $tipath;
    echo "<br><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" width=\"100%\">\n"
    ."<tr>\n"
    ."<td>\n"

   ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr>\n"
   ."<td align=\"left\" valign=\"top\" width=\"26\" height=\"30\"><img src=\"themes/XPMidnight/images/sidebox-title-left.gif\"></td>\n"
   ."<td align=\"left\" valign=\"middle\" background=\"themes/XPMidnight/images/sidebox-title-bg.gif\" width=\"100%\" height=\"30\">\n"
   ."<font class=\"storytitle\" color=\"#363636\">&nbsp;&nbsp;<b>$title</b></font>\n"
   ."</td>\n"
   ."<td align=\"left\" valign=\"top\" width=\"6\" height=\"30\"><img src=\"themes/XPMidnight/images/sidebox-title-right.gif\"></td>\n"
   ."</tr>\n"
   ."</table>\n"

   ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr>\n"
   ."<td>\n"

   ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr>\n"
   ."<td align=\"left\" valign=\"top\" width=\"15\" height=\"42\"><img src=\"themes/XPMidnight/images/storybox-left.gif\"></td>\n"
   ."<td align=\"left\" valign=\"middle\" background=\"themes/XPMidnight/images/storybox-bg.gif\" width=\"100%\" height=\"42\">\n"
   ."<font color=\"#747474\" size=\"1\">"._POSTEDBY." ";
    formatAidHeader($aid);
    echo " "._ON." $time $timezone ($counter "._READS.")</font>\n"
   ."<font color=\"#747474\">$morelink</font>\n"
   ."</td>\n"
    ."<td width=\"12\" align=\"left\" valign=\"top\"><img src=\"themes/XPMidnight/images/storybox-right.gif\"></td>\n"
   ."</tr>\n"
   ."</table>\n"

   ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr>\n"
   ."<td width=\"4\" align=\"left\" valign=\"top\" background=\"themes/XPMidnight/images/sidebox-bar-left.gif\"><img src=\"themes/XPMidnight/images/sidebox-bar-px.gif\"></td>\n"
   ."<td>\n"

   ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr valign=\"top\">\n"
   ."<td>\n"
   ."<font color=\"#747474\"><b><a href=\"search.php?query=&amp;topic=$topic\"><img src=\"$tipath$topicimage\" border=\"0\" Alt=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a></B></font>\n";
    FormatStory($thetext, $notes, $aid, $informant);
    echo "</td></tr></table>\n"
    ."</td>\n"
    ."<td width=\"13\" align=\"left\" valign=\"top\" background=\"themes/XPMidnight/images/storybox-content-right.gif\"><img src=\"themes/XPMidnight/images/storybox-content-right-px.gif\"></td>\n"
    ."</tr></table>\n"

   ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
   ."<tr valign=\"top\">\n"
   ."<td width=\"9\" height=\"29\" align=\"left\" valign=\"top\"><img src=\"themes/XPMidnight/images/storybox-bottom-left.gif\"></td>\n"
   ."<td width=\"100%\" height=\"29\" background=\"themes/XPMidnight/images/storybox-bottom-bg.gif\">&nbsp;</td>\n"
   ."<td width=\"18\" height=\"29\" align=\"left\" valign=\"top\"><img src=\"themes/XPMidnight/images/storybox-bottom-right.gif\"></td>\n"
    ."</table>\n"

    ."</td></tr></table>\n"

    ."</td></tr></table>\n";
}



I made some changes in the first one to get rid of the italic formatting of the stories. I assumed (most likely mistakenly) that this is where my line break problem was too, bu I didn't see it in there. I am a total PHP n00b so that prolly doesn't help.

Thanks to everyone in advance for their thoughts.


Last edited by LCJ_Eric on Thu Jun 28, 2007 12:48 pm; edited 2 times in total 
LCJ_Eric
PostPosted: Thu Jun 28, 2007 10:06 am Reply with quote

I never did get this figure out. Anyone have any ideas on this?
 
floppydrivez
Involved
Involved


Joined: Feb 26, 2006
Posts: 340
Location: Jackson, Mississippi

PostPosted: Thu Jun 28, 2007 10:56 am Reply with quote

First off I would like to say if you would use the code tags provided with phpbb it would make your post a lot easier to follow.

Open theme.php of your current theme. Find function themearticle

The below is an example not exactly sure what yours will look like.

Code:
        if($informant != "") {

            $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
        } else {
            $content = "$anonymous ";
        }
        $content .= ""._WRITES." \"$thetext\"$notes\n";
    }


The only line needed out of that whole bit to pull this hack off is
Code:
$content .= " \"$thetext\"$notes\n";
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LCJ_Eric
PostPosted: Thu Jun 28, 2007 12:08 pm Reply with quote

Sorry about not using the code tags. Liek I said - I am not saavy at php.

I found themearticle, but the code you refereced is not located there in my theme. It is in themeindex where evaders first pointed me.
Code:


function FormatStory($thetext, $notes, $aid, $informant) {
    global $anonymous;
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b> $notes>\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   echo "<font class=\"content\">$thetext$notes</font>\n";
    } else {
   if($informant != "") {
       $boxstuff = "<i><a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a></i> ";
   } else {
       $boxstuff = "$anonymous ";
   }
   $boxstuff .= "".translate("<i>writes</i>")." \"$thetext\"$notes\n"; echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";
    }
}


Let me add that this occurs anytime a story is posted by a user OTHER THAN me. If I post a story, it doesn't happen.

I know I could just take out the "<username> writes" but I want the contributors to get proper credit.

If you take a look at the site (www.lcjs.org) you can see what I mean
 
floppydrivez
PostPosted: Thu Jun 28, 2007 12:29 pm Reply with quote

Try something like this

Code:
$boxstuff .= "".translate("<i>writes</i>")."<br />\"$thetext\"$notes\n"; echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";

    }
}
 
floppydrivez
PostPosted: Thu Jun 28, 2007 12:34 pm Reply with quote

Notice all I did was add <br /> before the first slash close to the $thetext
 
LCJ_Eric
PostPosted: Thu Jun 28, 2007 12:54 pm Reply with quote

I tried as you suggested, here are the results:

Before The Change
DUNKS writes "
LCJ Highway Clean-up
There has been an impromptu Highway.....

After The Change
DUNKS writes
"
LCJ Highway Clean-up
There has been an impromptu Highway.....


What I would really like it to be is:
DUNKS writes
"LCJ Highway Clean-up
There has been an impromptu Highway.....

OR

DUNKS writes...
LCJ Highway Clean-up
There has been an impromptu Highway.....

or something similar.

I really just want the quote mark, if there must be one, to be on the same line the actual story begins on.

I really do appreciate your help!
 
floppydrivez
PostPosted: Thu Jun 28, 2007 1:27 pm Reply with quote

Looks like where ever $thetext is formed there is a break.

I may have to try it on my local to get the desired result. I am just guessing atm.
 
floppydrivez
PostPosted: Thu Jun 28, 2007 1:34 pm Reply with quote

Try it like this

Code:
<br />$thetext\"$notes\n
 
LCJ_Eric
PostPosted: Thu Jun 28, 2007 3:38 pm Reply with quote

Excellent - I believe I have success. Here is what I ended up up for code:
Code:
$boxstuff .= "".translate("<i>writes</i>")."...<br />$thetext $notes"; echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";


Everything looks like how I ultimately wanted it.
The quote marks are gone completely and I have an elipses (spelling?) after "writes"

I had to make one extra change to get it to be how it is now. The code was

Code:
<br />$thetext\$notes\n"; 


It now is
Code:
<br />$thetext $notes"; 


If that seems legit, I am going to call it good as it look great from a visualk standpoint.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©