Jump to content


RandomAd format help


  • You cannot reply to this topic
2 replies to this topic

#1 lvanderb

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 06 December 2004 - 01:43 AM

Hi,

I'm pretty new to Etomite - so, noob status to me, please!

I modified the RandomAd snippet to work for quotes - didn't find the RandomQuote snippet, so this is what I'm using

// Load Ads to display
$randomad= array();
$adfile = $file.".txt";


// Read one line per ad
$fh = fopen($adfile, "r");
while(!feof($fh)) {

  $line = fgets($fh, 10240);
  $line = trim($line);
  if($line != "") {
	$randomad[] = $line;
  }
}

// Pick a random Ad to display
$num = count($randomad);
$idx = rand(0, $num-1);

$output= $randomad[$idx];

return $output."";

I'm trying to put it in a box or something, but no matter where I put class="logobox" or whatever class I try to use, nothing happens.

Site is here: My Etomite Webpage

Please tell me I'm missing something really, really basic!

Thanks,
Linda

#2 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 06 December 2004 - 12:35 PM

Well it looks like you got the quote to show up. That's a good start. And it's showing up where you want it... I suppose. You have probably moved around your class several times (which is what I usually wind up doing when experimenting), but I only know where it is now- which is attached to a <tr> tag. Table rows, in my experience, are not great places to attach styles. I don't care for <td> cells either. What I would do is wrap my quote snippet call in a <div> tag and put it in the <td> cell you want- so something like:

<td>
  <div class="logobox">
    [[YourQuoteSnippetCall]]
  </div>
</td>
If you want to put this in the content of the page, keep in mind you can call a snippet from the content itself (using the create/edit document in the manager). Just inlude the snippet call in the content. If you want to associate it with a style class, you may have to use the HTML mode of HTMLarea or TinyMCE.

#3 lvanderb

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 06 December 2004 - 01:56 PM

Thanks!

Well, I used the div, AND spelling the class name correctly really was what did the trick! All this time I was using class="logobox" instead of class="logoBox". :blink:

Linda





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users