Page 1 of 1

Menu box link background coloring.

Posted: Sun 26. Aug 2007, 06:42
by armababy
First of all i would like to say sorry about all those threads this week but its just to make web better :D

So problem (thing i don't know) :

How to make links background coloring in custom menu box like THIS

Its like you have each links background in different color black, white, black, white and so on.

Btw i want use this on {RELATED} RT (mybe there is sucha function)

Posted: Sun 26. Aug 2007, 11:42
by Oliver Georgi
Alternating class/settings is not possible by default. So you have to develope your own or thing about different solution.

Oliver

Posted: Sun 26. Aug 2007, 23:40
by armababy
Thanks for answer Oliver any idea how this thing called ?

Posted: Mon 27. Aug 2007, 00:12
by Oliver Georgi
Sure. I have posted custom menu script somewhere here in forum.

Oliver

Posted: Mon 27. Aug 2007, 01:04
by armababy
Okey i hope its not in German.
I'll search forum.

Posted: Mon 27. Aug 2007, 05:09
by Pappnase
armababy wrote:Okey i hope its not in German.
I'll search forum.
hello
an if it's would be. ask for an translation :-)

Posted: Mon 27. Aug 2007, 06:54
by armababy
Cant find anything in phpBB search TT
Actually i have found some tutorials about alternating background, but all of them is pretty hard to understand for guy who is low @ php :(

Would be really preciated if someone could tell me where to put this. (this is what i found!)

Code: Select all

<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="test_mysql"; // Table name

// Connect to server and select databse
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);

// Define $color=1
$color="1";

echo '<table width="400" border="1" align="center" cellpadding="2" cellspacing="0">';
while($rows=mysql_fetch_array($result)){

// If $color==1 table row color = #FFC600
if($color==1){
echo "<tr bgcolor='#FFC600'>
<td>".$rows['id']."</td><td>".$rows['name']."</td><td>".$rows['email']."</td>
</tr>";
// Set $color==2, for switching to other color
$color="2";
}

// When $color not equal 1, use this table row color
else {
echo "<tr bgcolor='#C6FF00'>
<td>".$rows['id']."</td><td>".$rows['name']."</td><td>".$rows['email']."</td>
</tr>";
// Set $color back to 1
$color="1";
}

}
echo '</table>';
mysql_close();
?>

Posted: Mon 27. Aug 2007, 09:58
by armababy
Okey i got this http://straddle.lv/cms/test.php
Can someone tell me what i have to call from db_table to get same effect as {RELATED:5:keyword}

So basicaly

Code: Select all

SELECT * FROM article_title ORDER BY article_id DESC LIMIT 0, 5
works fine. I just need somehow call keywords :( mysql pros help

Posted: Mon 27. Aug 2007, 11:18
by Oliver Georgi
Do NOT connect to database again!

Oliver

Posted: Mon 27. Aug 2007, 11:24
by armababy
Oliver Georgi wrote:Do NOT connect to database again!

Oliver
mmm why ? :roll:

Posted: Tue 28. Aug 2007, 00:03
by armababy
mokey i won't make that thing will just do one color rolover background :(

Posted: Tue 28. Aug 2007, 07:25
by Oliver Georgi
phpwcms connects itself - so you can hook up that connection.

You have to be familiar with PHP to handle this.

Oliver

Posted: Fri 31. Aug 2007, 02:10
by armababy
Thanks anyway Oliver i will see what i can do about this!