Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Different backgrounds

Featured Replies

Hello,

I was wondering what the way of making a single vertical table show its contents with different(2) backgrounds. Let me give you an example. Let's say a sidebar "categories" table the first category background is white, the second - black, and this is repeated with every new added category. Hope you could help me. Thanks in advance and sorry for my bad english.

I'm not exactly sure what you mean, but if you're using a table you could just create separate rows and give each row a different coloured background - alternate them, if you know what I mean, so one row has a white background and the next has a grey background for example.

 

If you're not wanting to use different rows you could create a couple of styles in your style sheet and apply these to each paragraph so one would be

 

<p class="whitebg>content</p>

 

and the next would be

 

<p class="greybg">content</p>

 

does that make sense? Not sure if that is what you are after. Have you got any examples to show of sites out there doing what you want to achieve - might be good to put a link in to illustrate the effect you want.

That looks far too geeky for me - you've outdone me there Ben! Looks like that might do the trick though...

  • Author

Well that might do the trick if i could understand it :(

Here is my php code

 $nextEventsSelect = myQ("
		SELECT *
		FROM `[x]events` 
		WHERE (
			(`display`='private' AND `user`='".me("id")."')
			OR
			(`display`='shared' AND (`user`='myFriendID' OR `user`='myFriendID2'))
			OR
			(`display`='public')
			OR
			(`display`='system')
		)
		AND `date` > '".date("U")."'
		ORDER BY `date` ASC
		LIMIT 5
	");

	/*
		Loop in the results, create the looping array
	*/
	$i=0;
	while ($nextEventRow = myF($nextEventsSelect)) {
		$nextEventsReplacementArray[$i]["event.title"] = strtrim($nextEventRow["title"], 30);
		$nextEventsReplacementArray[$i]["event.date"] = date($CONF["LOCALE_SHORT_DATE"], $nextEventRow["date"]);
		$nextEventsReplacementArray[$i]["event.id"] = $nextEventRow["id"];
		$nextEventsReplacementArray[$i]["event.location"] = $nextEventRow["location"];
		$nextEventsReplacementArray[$i]["event.body"] = $nextEventRow["body"];
		$nextEventsReplacementArray[$i]["event.username"] = user($nextEventRow["user"], "username");

		$i++;
	}

	$tpl -> Zone("nextEvent", "enabled");
		$tpl -> Loop("nextEvents", $nextEventsReplacementArray);

 

And here is the code in my .tpl file

<td><LOOP nextEvents>
					<div style="clear:both; padding-bottom:4px; padding-top:5px; border-bottom: solid 1px #E5E9EC;"><img src="system/image.php?file={event.mainpicture}&width=30" name="picture" hspace="2" border="0" align="left" id="picture" /> <a href="?L=users.profile&id={event.username}"> </a> <a href="?L=events.event&id={event.id}" class="style2">{event.title}...</a>
						<h5>Date: {event.date}</h5>
					</div>
				  </LOOP nextEvents></td>

I think I'm going to bow out of this one - far too complicated for me...

  • Jo 90 locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.