Jump to content

Need help with link script.


Gfer

Recommended Posts

Hey there, I need some help with my php script. It's designed to put in entries/links under a headline which is the day they were added into the database. So it looks like this for example:

 

2008-09-25

entry4

2008-09-24

entry3

entry2

entry1

 

and so on, however my problem is that I can't figure out a way to put a </div> where the entries stop for the day. I wan't it to be so that I can manipulate all the entries for one day seperately and so on. Here's my code.

 

$olddate= "";
?>
<div class="holder2">
<?php
        while($row = mysql_fetch_array($result)) {  
            list($id, $rubrik, $embedurl, $lankurl, $klick, $date, $tid, $kat, $tipsare) = $row;

            $qcount = mysql_query("SELECT * FROM kommentarer where nid='".$row['id']."'");
            $scount = mysql_num_rows($qcount);

        if($olddate != $date) {
        $olddate = $date;
?>
<div class="dateholder"><p><?php echo $date; ?></p></div>
    <?php
                                      } // end if

    ?>
    <div class="linkholder">
        <ul>

<?php
        if($embedurl != '') {
?>
        <li><a href="lank.php?id=<?php echo $id; ?>" target="_blank"><?php echo $rubrik;?></a></li>
<?php
                    }  else {
?>
        <li><a href="redir.php?id=<?php echo $id; ?>" target="_blank"><?php echo $rubrik;?></a></li>
<?php
}
?>  
      <li><small><?php echo $tid;?></small></li>
        <li><a href="#" onClick="window.open('kommentar.php?id=<?php echo $id; ?>','mywindow','width=350,height=400')"><?php echo $scount;?> Inlägg</a></li>
        <li>Klick: <?php echo $klick;?></li>
        <li>Kategori: <?php echo $kat;?></li>
        <li>Tipsare: <?php echo $tipsare;?></li>
        <li>Rating: <?php echo rating_bar($id,'5'); ?></li>
    
      </ul>
        </div>

<?php 
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/125702-need-help-with-link-script/
Share on other sites

That's what I done for the links inside the headline, I need to close them all up when the new date comes with a </div>. Do I need to save another variable as $olddate2? I want to create a holder for each day so that I can manipulate every day with all the links independantly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.