Jump to content

ldb358

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

Posts posted by ldb358

  1. ive gotten it down to this to search and replace through the document:

               
    foreach($this->filter as $name => $value){
          $this->output = preg_replace('/{$name.*?([0-19]).*?}/', $value, $this->template);
    }
    

    but it doesn't actually replace any thing Ive never worked with regex so i dont exactly know what I'm doing but any help would be nice

  2. okay what im doing is a template parsing system where it reads the file and would replace {test} with content but lets say i have a place where it lists out 20 videos  i want to be able to put {test(1)} and it would be replaced with the first video(which would be stored in an array) and {test(2)} to be replaced with the second video and so on

  3. i've been looking for a way to do this but cant seem to find anything:

    what i want to do is say i have {test} i want to be able to replace it with 'hello' but if i have {test(1)} i want to replace test with the first value in an array(i already have a function that reads and replaces all of {test} but i cant get the array/number part of it to work).

  4. i am making a custom cms but i am stuck with the concept behind having custom themes (thus while i posted here) what i am wondering is how can i place my content with-in a theme file while still giving people the ability to write there own themes with no restrictions

  5. okay lets start:

     

    1) it looks pretty good and i liked the feel

    2)the text in the links are slightly difficult to read not a big issue for me but might be for someone else

    3)the red square in the bottom left is unnecessary and take away from the site

    And lastly the load time was kind of slow and would be impossible on dial up

     

    all together it looks nice, the purpose is clear and the feel is good with just a couple minor issues

  6. okay you document is formated all wrong:

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

     

    <title>

    <?php

    wp_title( '-', true, 'right' );

    echo wp_specialchars( get_bloginfo('name'), 1 )

    ?>

    </title>

     

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

     

    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

     

    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

     

    <?php if ( is_singular() ) {

    wp_enqueue_script( 'comment-reply' ); } ?>

     

    <?php wp_head(); ?>

    </head>

    a)that should all be in the head tag which should be in the html tag

    b) your nested all wrong, and not all your tags have a closing tag this means you Code is invalid

    <body>

    <div id="wrapper">

    <div id="header">

    <img src="http://thesidetracked.com/wp-content/uploads/2009/09/tstv3logo1.png" align="left">

    <ul id="">

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title> Stu Nicholls | CSSplay | Professional series drop#2</title>

    <style type="text/css">

    c) your head cannot be in your body it has to be before

    d)you have a second doctype declaration which you cant do

    e)you have a second title your only aloud one of those per a document

     

    <body>

    <span class="preload2"></span>

     

    <ul class="menu2">

     

    you cant have 2 body tags eather

     

    </div>

     

    </body>

    </html>

     

    </ul>

     

    the </ul> must go before body and html or i can guaranty its nested

     

    that may not solve your problem but it just might that code is pretty messed up

     

  7. i don't get what you are asking can you clarify

     

    Edit: do you want to do somthing like this?:

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    $finish[$i] = $row[2];
    $centre_name[$i] = $row[1];
    $i++;
    }
    switch(mysql_num_rows($results)){
       case "4":
    echo 'your nearest 4 centre are '.$centre_name['0']."(".$finish['0'].")" . ", " .$centre_name['2']."(".$finish['1'].")" . ", " .$centre_name['2']."(".$finish['2'].")" . ", and " .$centre_name['3']."(".$finish['3'].")";
       break;
      case "3":
    echo 'your nearest 3 centre are '.$centre_name['0'] ."(".$finish['0'].")" . ", " .$centre_name['1'] . "(".$finish['1'].")" .  ", and " .$centre_name['2']."(".$finish['2'].")" ;
       break;
      case "2":
    echo 'your nearest 2 centre are '.$centre_name['0']. "(".$finish['0'].")" . ", and " .$centre_name['1']."(".$finish['1'].")";
      break;
      case "1":
    echo 'your nearest centre is '.$centre_name['0']."(".$finish['0'].")";
      break;
      case "0":
    echo "no records found";
      break;
    case "5":
    default:
    echo 'your nearest 5 centre are '.$centre_name['0'] . "(".$finish['0'].")" . ", " .$centre_name['1'] . "(".$finish['1'].")" . ", " .$centre_name['2'] . "(".$finish['2'].")" . ", " .$centre_name['3'] . "(".$finish['3'].")" . ", and " .$centre_name['4']."(".$finish['4'].")" . ;
    }
    
    

  8. okay this should fix the results if there is only 1(or less than 5):

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    $finish[$i] = $row[2];
    $centre_name[$i] = $row[1];
    $i++;
    }
    switch(mysql_num_rows($results)){
       case "4":
    echo 'your nearest 4 centre are '.$centre_name['0'] . ", " .$centre_name['1'] . ", " .$centre_name['2'] . ", and " .$centre_name['3'] ;
       break;
      case "3":
    echo 'your nearest 3 centre are '.$centre_name['0'] . ", " .$centre_name['1'] . ", and " .$centre_name['2'];
       break;
      case "2":
    echo 'your nearest 2 centre are '.$centre_name['0'] . ", and " .$centre_name['1'];
      break;
      case "1":
    echo 'your nearest centre is '.$centre_name['0'];
      break;
      case "0":
    echo "no records found";
      break;
    case "5":
    default:
    echo 'your nearest 5 centre are '.$centre_name['0'] . ", " .$centre_name['1'] . ", " .$centre_name['2'] . ", " .$centre_name['3'] . ", and " .$centre_name['4'];
    }
    

  9. try this with you first while loop:

    $i=0;
    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    $finish[$i] = $row[2];
    $centre_name[$i] = $row[1];
    $i++;
    }
    
    echo 'your nearest 5 centre are '.$centre_name['0'] . ", " .$centre_name['1'] . ", " .$centre_name['2'] . ", " .$centre_name['3'] . ", " .$centre_name['4'];
    

  10. all i want to do is use array_walk within my class heres what i have but it returns an undefined function:

    array_walk($values, '$this->prep');
    array_walk($columns, '$this->prep');
    

    also tried with the same return:

            array_walk($values, 'prep');
            array_walk($columns, 'prep');
    

  11. try this:

    <?php
    
    include("includes/nSiteSQL.php");
    
    include("admin/common/print_array.php");
    
    
    
    function getHeadlines() {
    
    
    
       $newsheadlines = array();
    
    
       
    
       $db = new nSQL();
    
       $q = "SELECT ID, date_format(nDate, '%m.%d.%Y') as nDateF, nTitle, nDate FROM `gtt_news` ORDER BY `nDate` DESC LIMIT 5;";
    
       $db->select($q);
    
       
    
       while($data = $db->get_row(MYSQL_NUM)) {
    
          $key = $data[3] . "news";
    
          $newsheadlines[$key] = $data;
    
          $newsheadlines[$key][4] = "news";
    
       }
    
       
    
       $new = array_merge($newsheadlines);
    
       krsort($new);
    
    
    
       $count = 0;
    
       foreach($new as $key => $val) {
    
          if($count<3) {
    
             $type = $val[3];
    
             if($type == 'blog') {
    
                $link = "blogarchive.php?blogID=".$val[0];
    
             } else {
    
                $link = "newsarchive.php?newsID=".$val[0];
    
             }
             $numberofcharaters = 50;
             if(strlen($val[2]) > $numberofcharaters){
                             list($body, $extra)  = str_split($val[2], $numberofcharaters);
                             $body = $body . "...";
             }else{
                    $body = $val['2'];
            }
    
             echo "<div class=\"newsitem\">";
    
             echo "<p class=\"date\">".$val[1]."</p>";
    
             echo "<p class=\"text\">$body</p>";
    
             echo "<p class=\"text\"><a href=\"$link\">read more</a></p>";
    
             echo "</div>"; 
    
             
    
             $count++;
    
          }
    
       }
    
    
    
    }
    
    
    ?>
    

×
×
  • 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.