Menu box link background coloring.

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Menu box link background coloring.

Post 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)
User avatar
Oliver Georgi
Site Admin
Posts: 9920
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Alternating class/settings is not possible by default. So you have to develope your own or thing about different solution.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post by armababy »

Thanks for answer Oliver any idea how this thing called ?
User avatar
Oliver Georgi
Site Admin
Posts: 9920
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Sure. I have posted custom menu script somewhere here in forum.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post by armababy »

Okey i hope its not in German.
I'll search forum.
Pappnase

Post 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 :-)
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post 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();
?>
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9920
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Do NOT connect to database again!

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post by armababy »

Oliver Georgi wrote:Do NOT connect to database again!

Oliver
mmm why ? :roll:
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post by armababy »

mokey i won't make that thing will just do one color rolover background :(
User avatar
Oliver Georgi
Site Admin
Posts: 9920
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

phpwcms connects itself - so you can hook up that connection.

You have to be familiar with PHP to handle this.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
armababy
Posts: 30
Joined: Wed 22. Aug 2007, 06:14

Post by armababy »

Thanks anyway Oliver i will see what i can do about this!
Post Reply