Jump to content

Archived

This topic is now archived and is closed to further replies.

runnerjp

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

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]

Share this post


Link to post
Share on other sites
sweet thanks....any idea about adding the picture

and changein the text to white... tride to add codes in and keep gttin errors... simple i know yet its l8 lol had bad day need to fin of this so i can sleep well 2night haha cheers

Share this post


Link to post
Share on other sites
[code]
$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)

[/code]

Share this post


Link to post
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>

Share this post


Link to post
Share on other sites
well i want the white text on a black background u see :D where do i add the white text code :P

Share this post


Link to post
Share on other sites
just like to say tho that the image link worked :D:D nice 1 yeey lol just white text and its dun :P

Share this post


Link to post
Share on other sites
[quote author=runnerjp link=topic=105232.msg420240#msg420240 date=1156281349]
where do i add the white text code
[/quote]

Where you want the white text

Share this post


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

Or do:

[code]
echo "<marquee><font size='3' color='#ffffff'>". $marquee. "</font></marquee>"
[/code]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
The '&nbsp;' isn't quite right.

Can you post the marquee code you are now using.

PS Just refreshed the page and don't see any marquee text/images

Share this post


Link to post
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

Share this post


Link to post
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 :)

Share this post


Link to post
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

Share this post


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

doesn't have a [b];[/b] at the end... could that be the problem?

Share this post


Link to post
Share on other sites
Parse error: syntax error, unexpected '}' in /home/runnerse/public_html/chatbox/maq.php on line 19

Share this post


Link to post
Share on other sites
ok done it i deleted the { lol

is their away to control the speed of the marquee ?

Share this post


Link to post
Share on other sites
and to stop long gap between posts  take alook and ull see what i mean [url=http://www.runnerselite.com]www.runnerselite.com[/url]

Share this post


Link to post
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 :)

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
see the big gap.... i would rlly like it like this

[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....[/move]

Share this post


Link to post
Share on other sites
This should help you customize your marquee to how you want it:

http://www.htmlcodetutorial.com/_MARQUEE.html

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.