Jump to content


Photo

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


  • Please log in to reply
24 replies to this topic

#1 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 08:38 PM

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 http://www.runnersel...mage/runner.gif to split them up

also if you look at the page its on www.runnerselite.com 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

<?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>";
?>


#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 22 August 2006 - 08:55 PM

$marquee.= $r[poster]. '&nbsp;&nbsp'. $r[message]. '</a>';
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:01 PM

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

#4 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:11 PM

$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)


What is the CoronaMatrix?

#5 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 22 August 2006 - 09:13 PM

[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>";
?>

Do you really want whit text on a white background?

<span style="color: white"> text here </span>
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#6 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:15 PM

well i want the white text on a black background u see :D where do i add the white text code :P

#7 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:17 PM

just like to say tho that the image link worked :D:D nice 1 yeey lol just white text and its dun :P

#8 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 22 August 2006 - 09:18 PM

where do i add the white text code


Where you want the white text
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#9 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:19 PM

echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

Or do:

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

What is the CoronaMatrix?

#10 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:24 PM

white text works... pciture doesnt :(

<?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


#11 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 22 August 2006 - 09:30 PM

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
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#12 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:32 PM

<?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]

thats code....since i added the picture script its all gone got an error on 19th line

#13 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:32 PM

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:

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'>";


Your choice though :)
What is the CoronaMatrix?

#14 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:35 PM

ok i added

<?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>"

?>

and still its not showin up :( error on line 19

#15 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 22 August 2006 - 09:36 PM

what error message
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#16 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:37 PM

echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

doesn't have a ; at the end... could that be the problem?
What is the CoronaMatrix?

#17 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:38 PM

Parse error: syntax error, unexpected '}' in /home/runnerse/public_html/chatbox/maq.php on line 19

#18 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:39 PM

ok done it i deleted the { lol

is their away to control the speed of the marquee ?

#19 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 22 August 2006 - 09:41 PM

and to stop long gap between posts  take alook and ull see what i mean www.runnerselite.com

#20 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:46 PM

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

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

The scroll delay doesn't necessarily have to be 90... change it to your liking :)
What is the CoronaMatrix?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users