Jump to content

code needs addin to/editin lol ...good php help needed


runnerjp

Recommended Posts

hey just had help with gttin this script to work...now i need to tweak it a ll

is their away so in between each post it displayes this image [url=http://www.runnerselite.com/image/runner.gif]http://www.runnerselite.com/image/runner.gif[/url] to split them up

also if you look at the page its on [url=http://www.runnerselite.com]www.runnerselite.com[/url] you can see that the username and the message does not have a space inbetween it so its all crunched together  is their away so a can add [  (space):  ] to it if you get me....basicly space it out??

heres code

[code]<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
while($r=mysql_fetch_array($result))
{
   $marquee.= $r[poster]. ''. $r[message]. '</a>';
}
echo "<marquee><font size='3'>". $marquee. "</font></marquee>";
?>[/code]
Link to comment
Share on other sites

[code][try
code]<?php
while($r=mysql_fetch_array($result))
{
  $marquee.= $r[poster]. '&nbsp;&nbsp;'. $r[message]. '<img src="image/runner.gif">';
}
echo "<marquee><font size='3'>". $marquee. "</font></marquee>";
?>[/code]

Do you really want whit text on a white background?

<span style="color: white"> text here </span>
Link to comment
Share on other sites

white text works... pciture doesnt :(

[code]<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
$i = 0;
while($r=mysql_fetch_array($result))
{
  $posts[$i] = $r[poster].' - '. $r[message]. '';
  ++$i;
}
$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts)
}
echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

?>code]

error on line 19[/code]
Link to comment
Share on other sites

[code]<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
$i = 0;
while($r=mysql_fetch_array($result))
{
  $posts[$i] = $r[poster].' - '. $r[message]. '';
  ++$i;
}
$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts)
}
echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

?>code][/code]

thats code....since i added the picture script its all gone got an error on 19th line
Link to comment
Share on other sites

Well you won't see the image if there is only 1 post entry.

I intentionally did it that way.  If you want the image to show even with 1 post than I would recommend:

[code]
while($r=mysql_fetch_array($result))
{
  $posts[$i] = "<img src='http://www.runnerselite.com/image/runner.gif'>".$r[poster].' - '. $r[message];
  ++$i;
}
$marquee = implode("", $posts)."<img src='http://www.runnerselite.com/image/runner.gif'>";

[/code]

Your choice though :)
Link to comment
Share on other sites

ok i added

[code]<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
$i = 0;
while($r=mysql_fetch_array($result))
{
  $posts[$i] = "<img src='http://www.runnerselite.com/image/runner.gif'>".$r[poster].' - '. $r[message];
  ++$i;
}
$marquee = implode("", $posts)."<img src='http://www.runnerselite.com/image/runner.gif'>";
}
echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

?>[/code]

and still its not showin up :( error on line 19
Link to comment
Share on other sites

Change this:
[code]<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>[/code]

To:
[code]<marquee scrolldelay='90'><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>[/code]

The scroll delay doesn't necessarily have to be 90... change it to your liking :)
Link to comment
Share on other sites

nope it didnt :( lol rite what i mean is it says 1st message then streight 2 second then massive lag till it loops over again like so

[move]hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                hello this is my 1st message...this is my second message                                [/move]
Link to comment
Share on other sites

Feature of marquee - waits for existing text to clear before restarting

Chain several sets together so gap only appears every 40 cycles say

[code]<?php
$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts);

for ($i=0; $i=40; $i++) $marqueeText .= $marquee;

echo "<marquee><font size='3'><span style='color: white'>". $marqueeText. "</span></font></marquee>"
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.