your welcome smile

include/user/recenttopics.inc.php

<div class="block">
  <h2><span>Last 10 Topics</span></h2>
  <div class="box">
    <div id="recenttopics" class="inbox">
<?php
echo "<ul>";
include("http://yourwebsite/extern.php?action=new&show=10");
echo "</ul>";
?>
    </div>
  </div>
</div>

and then in the .tpl

<pun_include "recenttopics.inc.php">

extern.php

Yep it still is, it has not been released yet.

255

(14 replies, posted in PunBB 1.2 troubleshooting)

open header.php and find <pun_title>

where do you populate $_SESSION['security_code'] all i see is session_start();
I think that is the fault.

See my Links.php with captcha

<?php
session_start('result');
define('PUN_ROOT', './');
define('PUN_MAIN', 1);
@include PUN_ROOT.'config.php';
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/email.php';
require_once PUN_ROOT."lang/".$pun_user['language']."/Links_with_category.php";
// title
$page_title = pun_htmlspecialchars( $pun_config['o_board_title'] ).' / 
              '.$lang_links['page_title'];
require PUN_ROOT.'header.php';
// here is the path where the images are
$path = PUN_ROOT."img/Links"; // without the trailing slash
/**
*        Mod title:  Links with category's
*          @author:  daniel rokven (rokven [at] gmail.com / http://kierownik.nl)
**/
error_reporting(E_ALL);
if ( isset( $_GET['id'] ) && intval( $_GET['id'] ) ) {
  $id = intval( $_GET['id'] );
  $id_check = $db->query('SELECT
                            `id`
                          FROM
                            '.$db->prefix.'links_links
                          WHERE
                            `id` = '.$id.'
                         ') or error('Unable select the link 
                         '. print_r($db->error()),__FILE__, __LINE__, $db->error());
  $numrows = $db->num_rows( $id_check );
  if ( $numrows < 1 ) {
    message( $lang_links['not a valid id'] );
  }
  $db->query('UPDATE
                '.$db->prefix.'links_links
              SET
                `hits` = `hits` + 1
              WHERE
                `id` = '.$id.'
           ') or error('Unable to update the hits 
           '. print_r($db->error()),__FILE__, __LINE__, $db->error());
  $query = $db->query('SELECT
                         `url`
                       FROM
                         '.$db->prefix.'links_links
                       WHERE
                         `id` = '.$id.'
                      ') or error('Unable select the link 
                      '. print_r($db->error()),__FILE__, __LINE__, $db->error());
  $link = $db->fetch_assoc( $query );
  $url = $link['url'];
  $url = str_replace('&', '&', $url);
  $url = str_replace('%3A', ':', $url);
  $url = str_replace('%2F', '/', $url);
  header("Location: ".$url."");
  exit();
}
if ( isset( $_GET['new_link'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace( '?new_link', '', $_SERVER['REQUEST_URI'] );
}
if ( isset( $_GET['id'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace( '?id='.$_GET['id'].'', '', $_SERVER['REQUEST_URI'] );
}
if ( isset( $_GET['statistics'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace('?statistics', '',$_SERVER['REQUEST_URI']);
}
if ( isset( $_GET['stats_all_by_link'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace('&stats_all_by_link', '',$_SERVER['REQUEST_URI']);
}
if ( isset( $_GET['stats_by_category_by_link'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace('&stats_by_category_by_link', '',$_SERVER['REQUEST_URI']);
}
if ( isset( $_GET['stats_by_category_total'] ) ) {
  $_SERVER['REQUEST_URI'] = str_replace('&stats_by_category_total', '',$_SERVER['REQUEST_URI']);
}
if ( $pun_config['o_links_captcha'] == '1' ) {
  function captcha()
  {
    global $lang_links;
    // Function demands a started session, check here if the session is started
    if ( session_id() == '' ) {
      message( $lang_links['captcha not started'] );
    }
    $numbers       = array( 0 => "".$lang_links['zero']."",
                            1 => "".$lang_links['one']."",
                            2 => "".$lang_links['two']."",
                            3 => "".$lang_links['three']."",
                            4 => "".$lang_links['four']."",
                            5 => "".$lang_links['five']."",
                            6 => "".$lang_links['six']."",
                            7 => "".$lang_links['seven']."",
                            8 => "".$lang_links['eight']."",
                            9 => "".$lang_links['nine']."",
                           10 => "".$lang_links['ten'].""
                          );
    $possibilities = array(
                      array("dummy", "dummy"),
                      array("+", "".$lang_links['plus'].""),
                      array("-", "".$lang_links['minus'].""),
                      array("*", "".$lang_links['times']."")
                          );
    // Het eerste getal van de rekensom (random)
    $first  = rand( 1,count( $numbers )-1 );
    $second = rand( 1,count( $possibilities )-1 );
    $third  = rand( 1,count( $numbers )-2 );
      if ( ( $first <= $third ) ) {
        $first = '10';
      }
    $firstInt = $first;
    $secondInt = $possibilities[$second][0];
    $thirdInt = $third;

    $firstText = $numbers[$first];
    $secondText = $possibilities[$second][1];
    $thirdText = $numbers[$third];

    $tmpResult = '$result = '.$firstInt.$secondInt.$thirdInt.';';
    eval($tmpResult);
    // Set the session
    $_SESSION['result'] = $result;
    // return the captcha to the user
    return $lang_links['what_is']." 
          ".$firstText." 
          ".$secondText." 
          ".$thirdText."?*";
  }
}

// if the insert button is hit, insert the link here
if ( isset( $_POST['insert'] ) ) {
  // check here if anybody may post a link, if not show message
  if ( $pun_config['o_links_guest_posts'] == '0' ) {
    message( $lang_links['error_no_post'] );
  }
  $category = intval($_POST['category']);
  $name        = $db->escape($_POST['name']);
  $url      = $db->escape($_POST['url']);
  // if the name of the link is empty show message
  if ( $name == '' OR strlen( $name ) > 50 ) { 
    message( ''.$lang_links['error_name'].'' );
  }
  if ( $url == 'http://' OR strlen( $url ) > 255) { 
    message( ''.$lang_links['error_url'].'' );
  }
  // if the link is empty show message
  if ( !preg_match( "/^[a-zA-z0-9:\/\.\-\?&_=]+$/",$url ) ) {
    message(''.$lang_links['error_url'].'');
  }
  // check if the category id exists
  $get_category = $db->query('SELECT
                                `id`
                              FROM
                                `'.$db->prefix.'links_category`
                              WHERE
                                `id` = '.$category.'
                             ') or error('Unable to get the category 
                             '. print_r($db->error()),__FILE__, __LINE__, $db->error());
  $num_cats = $db->num_rows( $get_category );
  if ( $num_cats < 1 ) {
   message( $lang_links['not existing category'] );
  }
  if ( $pun_config['o_links_captcha'] == '1' )    {
    // if the captcha is on and it was not correct show message
    if ( $_POST['captcha'] != $_SESSION['result'] ) {
      message( ''.$lang_links['error_captcha'].'' );
    }
  }
  if ( $pun_config['o_links_approve'] == '1' ) {
    $show   = '1';
    $target = '_blank';
  } else {
    $show   = '0';
    $target = '';
  }
  $url       = str_replace('&', '&',     $url);
  $url       = str_replace('&',     '&', $url);
  $db->query("INSERT INTO 
                `".$db->prefix."links_links`
                (`name`,
                 `url`,
                 `category`,
                 `target`,
                 `added`,
                 `show`)
              VALUES
                ('".$name."',
                 '".$url."',
                 '".$category."',
                 '".$target."',
                 '".time()."',
                 '".$show."')
          ") or error('Unable to insert the links 
          '. print_r($db->error()),__FILE__, __LINE__, $db->error());

  // if the webmaster wants an email when a link is inserted then send it here
  if ( $pun_config['o_links_send_mail'] == '1' ) {
    $get_category = $db->query('SELECT
                                  `category`
                                FROM
                                  `'.$db->prefix.'links_category`
                                WHERE
                                  `id` = '.$category.'
                               ') or error('Unable to get the category 
                               '. print_r($db->error()),__FILE__, __LINE__, $db->error());
    $link_category = $db->fetch_assoc($get_category);
    $admin_mail    = $pun_config['o_webmaster_email'];
    $subject       = $lang_links['new_link_posted'].'
                    '.$pun_config['o_board_title'].'';
    $message       = $lang_links['mail_message']."\n";
    $message      .= $lang_links['link_name'].' : '.$name.''."\n";
    $message      .= $lang_links['link_url'].' : '.$url.''."\n";
    $message      .= $lang_links['category'].' : '.$link_category['category'].''."\n";
    $message      .= $lang_links['mail_message_2'].' : '.$pun_config['o_base_url'].'';
    pun_mail( $admin_mail, $subject, $message, pun_htmlspecialchars( $pun_config['o_board_title'] ) );
  }
  $updated = true;

  if ( $updated ) { 
    // Regenerate the config cache
    require_once PUN_ROOT.'include/cache.php';
    generate_config_cache();
    $redirect = str_replace("?new_link", "", $_SERVER['REQUEST_URI']);
    redirect($redirect, $lang_links['link_saved']);
  }

} elseif ( isset( $_GET['new_link'] ) ) {
  // check here if anybody may post a link, if not show message
  if ( $pun_config['o_links_guest_posts'] == '0' ) {
    message( $lang_links['error_no_post'] );
  }
  if ( $pun_config['o_links_captcha'] == '1' ) {
      if ( session_id() == '' ) {
        message( $lang_links['captcha not started'] );
      }
  }
  ?>
    <div id="links">
<div class="blockform">
  <h2><?php echo $lang_links['add_new_link']; ?></h2>
  <div class="box">
    <div class="inbox">
      <form id="new_link" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
        <fieldset>
          <legend><?php echo $lang_links['add_new_link']; ?></legend>
            <label for="name">
              <?php echo $lang_links['link_name']; ?>*
            </label>
              <input id="name" type="text" name="name" maxlength="50" /><br />
            <label for="url">
              <?php echo $lang_links['link_url']; ?>*
            </label>
              <input id="url" type="text" name="url" maxlength="255" value="http://"
                /><br />
              <label for="category"><?php echo $lang_links['category']; ?></label>
              <select id="category" name="category">
                <?php
                  $query = $db->query('SELECT
                                         `id`, `category`
                                       FROM
                                         `'.$db->prefix.'links_category`
                                       ORDER BY
                                         `category`
                                         ASC
                                      ') or error('Unable to fetch category list
                                      ', __FILE__, __LINE__, $db->error());
                  while ( $data = $db->fetch_assoc( $query ) ) {
                    echo '<option value="'.$data['id'].'">'.pun_htmlspecialchars( $data['category'] ).'</option>';
                  }
                ?>
              </select>
              <?php
                if ( $pun_config['o_links_captcha'] == '1' ) {
                  echo ('<label for="captcha">'.captcha().'<br /><input id="captcha"
                          type="text" name="captcha" maxlength="80" /></label>');
                }
              ?>
              <label id="required" for="required"><?php echo '*<strong>'.$lang_links['required'].'</strong>'; ?></label>
              <label id="info" for="info"><?php echo $lang_links['add_new_link_info']; ?></label><br />
          </fieldset>
          <p><input type="submit" name="insert" value="<?php echo $lang_links['add_link']; ?>"/></p>
        </form>
      </div> <!-- end class inbox -->
    </div> <!-- end class box -->
  </div> <!-- end class blockform -->
</div> <!-- end id=Links -->
  <?php
} elseif ( isset( $_GET['statistics'] ) ) {
  if ( $pun_config['o_links_show_stats'] == '0' ) {
    message( ''.$lang_links['not see stats'].'' );
  }
  ?>
  <br />
  <div class="blockform">
    <h2>Clicks statistics</h2>
      <div class="box"><p style="padding-left: 15px;">
        <a href="<?php echo $_SERVER['REQUEST_URI'].'?statistics&stats_by_category_by_link' ?>"><?php echo $lang_links['By Category By Link'] ?></a> | <a href="<?php echo $_SERVER['REQUEST_URI'].'?statistics&stats_by_category_total' ?>"><?php echo $lang_links['By Category Total'] ?></a> | <a href="<?php echo $_SERVER['REQUEST_URI'].'?statistics&stats_all_by_link' ?>"><?php echo $lang_links['all links'] ?></a>
        </p></div>
  </div>
<?php
if ( isset( $_GET['stats_by_category_by_link'] ) ) {
        include "libchart/libchart.php";
    function php4_scandir($dir,$listDirectories=false, $skipDots=true) {
      $dirArray = array();
      if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
          if ($file != "." && $file != ".." || $skipDots == false) {
            #added the $dir. in this line
            if($listDirectories == false && is_dir($dir.$file)) { continue; }
              array_push($dirArray,basename($file));
          }
        }
        closedir($handle);
      }
      return $dirArray;
    }
    $file_height = '';
  ?>
  <br />
  <div class="blockform">
    <h2>Clicks statistics</h2>
      <div class="box" style="padding-left: 15px;"><br style="clear: both;" />
  <?php
  $fetch_category = $db->query("SELECT
                                  `id`, `category`
                                FROM
                                  `".$db->prefix."links_category`
                                ") or error( 'Unable to fetch category list
                                ', __FILE__, __LINE__, $db->error() );
  $i = 1;
  while ( $data = $db->fetch_assoc( $fetch_category) ) {
    $select_links = $db->query("SELECT
                                  `name`,
                                  `hits`
                                FROM
                                  `".$db->prefix."links_links`
                                WHERE
                                  `category` = ".$data['id']."
                                AND
                                  `show` = 1
                                ") or error( 'Unable to fetch category list
                                ', __FILE__, __LINE__, $db->error() );
    $numrows = $db->num_rows( $select_links );
    $category = $data['category'];
    if ( $numrows < 10 ) {
      $height_chart = $numrows * 50;
    } else {
      $height_chart = $numrows * 20;
    }
    if ( $height_chart < 100 ) {
      $height_chart = 100;
    }
    $chart = new HorizontalChart(500, $height_chart);
    $dir =  php4_scandir( 'libchart/generated/stats_by_category_by_link/' );
    foreach ( $dir as $file ) {
      $file_array = getimagesize('libchart/generated/stats_by_category_by_link/'.$file);
      if ( $file_height == '' ) {
        $file_height = $file_array['1'];
      } elseif ( $file_array['1'] > $file_height ) {
        $file_height = $file_array['1'];
      }
    }
    $height = ( $file_height / ( 500 / 150 ) ) + 20;
    while ( $data = $db->fetch_assoc( $select_links ) ) {
      $chart->addPoint(new Point("".$data['name']."", $data['hits']));
    }
    $category_name = pun_htmlspecialchars( $category );
    $chart->setTitle("".$category."");
    if ( !function_exists( 'clean_image_name' ) )
    {
      function clean_image_name($text)
      {
        $text=strtolower($text);
        $code_entities_match = array(' ','--','"','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','.','/','*','+','~','`','=');
        $code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');
        $text = str_replace($code_entities_match, $code_entities_replace, $text);
        return $text;
      }
    }
    $image_name = clean_image_name( $category );
    $chart->render("libchart/generated/stats_by_category_by_link/".$image_name."_".$i.".png");
    echo '<p style="text-align: center; padding: 3px; height: '.$height.'px; float: left;">';
    echo $category_name.'<br />';
    ?>
    <a href="<?php echo PUN_ROOT.'libchart/generated/stats_by_category_by_link/'.$image_name.'_'.$i ?>.png" class="highslide" onclick="return hs.expand(this)">
    <img alt="Horizontal bars chart" src="libchart/generated/stats_by_category_by_link/<?php echo $image_name.'_'.$i ?>.png" style="width: 150px; border: 1px solid gray;"/>
    </a>
    </p>
    <?php
    $i++;
  }
  ?>
  <div class="clearer"></div>
  <div class='highslide-caption' id='the-caption'>
    <a href="#" onclick="return hs.previous(this)" class="control" style="float:left; display: block">
      Previous
      <br/>
      <small style="font-weight: normal; text-transform: none">left arrow key</small>
    </a>
    <a href="#" onclick="return hs.next(this)" class="control" style="float:left; display: block; text-align: right; margin-left: 50px">
      Next<br/>
      <small style="font-weight: normal; text-transform: none">right arrow key</small>
    </a>
    <a href="#" onclick="return hs.close(this)" class="control">Close</a>
    <a href="#" class="highslide-move control">Move</a>
    <div style="clear:both"></div>
  </div>
  </div></div>
  <?php
} // end clicks all per link

if ( isset( $_GET['stats_by_category_total'] ) ) {
        include "libchart/libchart.php";
  ?>
  <br />
  <div class="blockform">
    <h2>Clicks statistics</h2>
      <div class="box">
  <?php
  $fetch_category = $db->query("SELECT
                                  `id`, `category`
                                FROM
                                  `".$db->prefix."links_category`
                                ORDER BY
                                  `category`
                                  DESC
                                ") or error( 'Unable to fetch category list
                                ', __FILE__, __LINE__, $db->error() );
  $numrows = $db->num_rows( $fetch_category );
  if ( $numrows < 10 ) {
    $height_chart = $numrows * 50;
  } else {
    $height_chart = $numrows * 20;
  }
  if ( $height_chart < 100 ) {
    $height_chart = 100;
  }
  $chart = new HorizontalChart(500, $height_chart);
  while ( $data_category = $db->fetch_assoc( $fetch_category) ) {    
    $select_links = $db->query("SELECT
                                  `show`,
                                  sum(hits) as hits,
                                  `category`
                                FROM
                                  `".$db->prefix."links_links`
                                WHERE
                                  `show` = 1
                                AND
                                  `category` = ".$data_category['id']."
                                GROUP BY
                                  `category`
                                ORDER BY
                                  `hits`
                                  DESC
                                ") or error( 'Unable to fetch category list
                                ', __FILE__, __LINE__, $db->error() );

    while ( $data1 = $db->fetch_assoc( $select_links ) ) {
      $chart->addPoint(new Point("".$data_category['category']."", $data1['hits']));
    }
  }
        $chart->setTitle("Which category is the most popular");
        $chart->render("libchart/generated/stats_by_category_total/stats_by_category_total.png");
  ?>
        <p style="text-align: center;">
          <img alt="Horizontal bars chart"  src="libchart/generated/stats_by_category_total/stats_by_category_total.png" style="border: 1px solid gray;"/>
        </p>
      </div>
    </div>
  <?php
} // end clicks per category total

if ( isset( $_GET['stats_all_by_link'] ) ) {
        include "libchart/libchart.php";
  ?>
  <br />
  <div class="blockform">
    <h2>Clicks statistics</h2>
      <div class="box">
  <?php
  $fetch_categories = $db->query("SELECT
                                    `name`, `hits`
                                  FROM
                                    `".$db->prefix."links_links`
                                  ORDER BY
                                    `hits`
                                    ASC
                                  ") or error( 'Unable to fetch category list
                                  ', __FILE__, __LINE__, $db->error() );
  $numrows = $db->num_rows( $fetch_categories );
  if ( $numrows < 10 ) {
    $height_chart = $numrows * 50;
  } else {
    $height_chart = $numrows * 15;
  }
                $chart = new HorizontalChart(500, $height_chart);
  while ( $data = $db->fetch_assoc( $fetch_categories ) ) {
    $chart->addPoint(new Point("".$data['name']."", $data['hits']));
  }
        $chart->setTitle("Which link is the most popular");
        $chart->render("libchart/generated/stats_all_by_link/stats_all.png");
  ?>
        <p style="text-align: center;">
          <img alt="Horizontal bars chart"  src="libchart/generated/stats_all_by_link/stats_all.png" style="border: 1px solid gray;"/>
        </p>
      </div>
    </div>
  <?php
} // end $_GET['stats_all_by_link']
} // end $_GET['click_statistics']


 else {
  ?>
    <div id="links">
  <?php
  if ( $pun_config['o_links_hits_count'] == '1' ) {
    $count_hits = true;
  } else {
    $count_hits = false;
  }
  if ( $pun_user['g_id'] == PUN_ADMIN ) {
    $admin = true;
  } else {
    $admin = false;
  }
  for ( $i = 1; $i < 5; $i++ ) {
    // select all category in column $i
    $query = $db->query('SELECT
                           `id`, `category`, `height`, `image`, `order`, `column`
                         FROM 
                            `'.$db->prefix.'links_category`
                          WHERE
                            `column` = "'.$i.'"
                          ORDER BY 
                            `height`
                            DESC
                          ') or error('Unable to fetch all the category\'s 
                          '. print_r($db->error()),__FILE__, __LINE__, $db->error());
    $numRows = $db->num_rows( $query );
    echo "\t".'<div class="links_column_'.$i.'">';
    if ( $numRows == '' ) {
      echo " ";
    }
    $last_column = '';
    while ( $cat = $db->fetch_assoc( $query ) ) {
    $cat_name = pun_htmlspecialchars( $cat['category'] );
      if ( !empty( $cat['order'] ) ) {
        if ( $cat['order'] == '1' ) {
          $order = 'name';
          $dir   = 'ASC';
        } elseif ( $cat['order'] == '2' ) {
          $order = 'name';
          $dir   = 'DESC';
        } elseif ( $cat['order'] == '3' ) {
          $order = 'added';
          $dir   = 'ASC';
        } elseif ( $cat['order'] == '4' ) {
          $order = 'added';
          $dir   = 'DESC';
        } elseif ( $cat['order'] == '5' ) {
          $order = 'hits';
          $dir   = 'ASC';
        } elseif ( $cat['order'] == '6' ) {
          $order = 'hits';
          $dir   = 'DESC';
        }         
      } else {
        $order = 'name';
        $dir   = 'ASC';
      }
      if ( !empty( $cat['image'] ) ) {
        $cat_image = '<img src="'.$path.'/'.$cat['image'].'" alt="'.$cat['image'].'" />';
      } else {
        $cat_image = '';
      }
      if ( $last_column != $cat['column'] ) {
        echo "\n\t\t".'<h2 class="links">'.$cat_image.' '.$cat_name.'</h2>';
      } else {
        echo "\n\t\t".'<br />'."\n\t\t".'<h2 class="links">'.$cat_image.' '.$cat_name.'</h2>';
      }
      $links = $db->query('SELECT
                              `id`, `name`, `url`, `title_tag`, `target`, `added`, `image`, `hits`
                            FROM
                              `'.$db->prefix.'links_links`
                            WHERE
                              `category` = "'.$cat['id'].'"
                            AND
                              `show` = 1
                            ORDER BY
                              `'.$order.'`
                              '.$dir.'
                            ') or error('Unable to fetch all links 
                            '. print_r($db->error()),__FILE__, __LINE__, $db->error());
      while ( $link = $db->fetch_assoc( $links ) ) {
        $url  = pun_htmlspecialchars( $link['url'] );
        $name = pun_htmlspecialchars( $link['name'] );
        if ( empty( $link['title_tag'] ) ) {
          $title_tag = $name;
        } else {
          $title_tag = $link['title_tag'];
        }
        if ( $admin ) {
          $admin_hits = "(".$link['hits'].")";
        } else { $admin_hits = ''; }
        if ( !empty($link['image']) ) {
          $image = "<img style=\"margin: 0px; padding: 0px; vertical-align: middle;\" src=\"".$path."/".$link['image']."\" alt=\"".$link['image']."\" />";
        } else {
          $image = "";
        }
        if ( $count_hits == '1') {
          if ( $link['target'] == "_blank" ) {
            echo ("\n\t\t\t".'<p class="links"><a href="'.$_SERVER['REQUEST_URI'].'?id='.$link['id'].'" onclick="window.open(this.href); return false;" title="'.$title_tag.'">'.$name.'</a> '.$image.' '.$admin_hits.'</p>');
          } else {
            echo ("\n\t\t\t".'<p class="links"><a href="'.$_SERVER['REQUEST_URI'].'?id='.$link['id'].'" title="'.$title_tag.'">'.$name.'</a> '.$image.' '.$admin_hits.'</p>');
          }
        } else {
            if ( $link['target'] == "_blank" ) {
              echo ("\n\t\t\t".'<p class="links"><a href="'.$url.'" onclick="window.open(this.href); return false;" title="'.$title_tag.'">'.$name.'</a> '.$image.'</p>');
            } else {
              echo ("\n\t\t\t".'<p class="links"><a href="'.$url.'" title="'.$title_tag.'">'.$name.'</a> '.$image.'</p>');
            }
        }
        $last_cat    = $cat['height'];
        $last_column = $cat['column'];
      }
    }
    echo "\n\t".'</div><!-- end div class="links_column_'.$i.'" -->'."\n";

}// end for loop

echo "\t"."<div class=\"clearer\"></div>";
  // look here if the webmaster wants the footer
  if ( $pun_config['o_links_debug_info'] == '1' ) {
    $all_links = $db->query('SELECT
                               `id`
                             FROM
                               `'.$db->prefix.'links_links`
                             WHERE
                               `show` = 1
                           ') or error('Unable to fetch all the links 
                           '. print_r($db->error()),__FILE__, __LINE__, $db->error());
    $all_cats  = $db->query('SELECT
                               `id`
                             FROM
                               `'.$db->prefix.'links_category`
                           ') or error('Unable to fetch all the category\'s 
                           '. print_r($db->error()),__FILE__, __LINE__, $db->error());
    $a_links = $db->num_rows( $all_links );
    $a_cats  = $db->num_rows( $all_cats );
    echo "\n\t".'<p style="text-align: center;">'.$lang_links['total_cats'].': '.$a_cats.' |  '.$lang_links['total_links'].': '.$a_links.'</p>';
  } else { echo "<br />"; } // end debug info
  // look here if anybody may post links, if so then show the link
  if ( $pun_config['o_links_guest_posts'] == '1' AND $pun_config['o_links_show_stats'] == '1' ) {
    echo ("\n\t".'<p style="text-align: center;"><a href="'.$_SERVER['REQUEST_URI'].'?new_link">'.$lang_links['add_new_link'].'</a> | <a href="'.$_SERVER['REQUEST_URI'].'?statistics">'.$lang_links['show stats'].'</a></p><br />');
  } elseif ( $pun_config['o_links_guest_posts'] == '1' AND $pun_config['o_links_show_stats'] == '0' ) {
    echo ("\n\t".'<p style="text-align: center;"><a href="'.$_SERVER['REQUEST_URI'].'?new_link">'.$lang_links['add_new_link'].'</a></p><br />');
  } elseif ( $pun_config['o_links_guest_posts'] == '0' AND $pun_config['o_links_show_stats'] == '1' ) {
    echo ("\n\t".'<p style="text-align: center;"><a href="'.$_SERVER['REQUEST_URI'].'?statistics">'.$lang_links['show stats'].'</a></p><br />');
  }
  
//   if ( $pun_config['o_links_guest_posts'] == '0' AND $pun_config['o_links_debug_info'] == '0' AND $pun_config['o_links_show_stats'] == '0' ) {
//     echo "<br />";
//   }
  echo "\n"."</div> <!-- end div id=\"links\" -->";
}

require PUN_ROOT.'footer.php';

why not make an update_mod.php ?

258

(9 replies, posted in PunBB 1.2 troubleshooting)

open include/template/main.tpl and remove <pun_title>

footer.php smile

or use this http://www.punres.org/desc.php?pid=361

why not download the sql and then open the sql and then replace [ url=" for [ url= and "] to ]
should that not be the easiest way?

262

(1 replies, posted in PunBB 1.2 discussion)

http://www.punres.org/browse.php?keywor … projects=1

use extern.php instead, open it and read how it is done.

Goto your admin-panel and then options.
search for "Additional menu items" and then add something link 1= <a href="link">Link name</a>
where 1 is the position of the link.

265

(9 replies, posted in PunBB 1.2 show off)

that is true, it was the only theme i liked smile
And i am not a designer roll big_smile

266

(9 replies, posted in PunBB 1.2 show off)

I have redone my site, what do you think smile

If you logged out you cannot get in any more. In the download of punbb there is a file called turn_off_maintenance_mode.php, upload that and run it, now you can log in again.

the next version(V3.0.0) of my mod is coming soon smile

http://www.punres.org/desc.php?pid=326

270

(10 replies, posted in General discussion)

hmm, so it is best to use varchar, ok I am going to change everything then smile

271

(10 replies, posted in General discussion)

So if i know for instance that target is not going to be larger than 6 characters, it is best to use varchar(6). Otherwise use text if i do not know the real length of it?

272

(10 replies, posted in General discussion)

so for what i am using it is alright to go with text instead of varchar?

273

(8 replies, posted in PunBB 1.2 troubleshooting)

which submenu?

274

(10 replies, posted in General discussion)

In reading the data and then display the data on the screen. I see that punbb uses both in there tables.

I have a 2 tables in my mod with various fields in them:
table: links_category

Field      Type       Null      Default       Links to      Comments      MIME
id         int(11)    no                         
category   text       yes       NULL                   
column     int(1)     yes       NULL                   
height     int(11)    yes       NULL                   
image      text       No                         
order      text       No

`category` contains a category name.
`image` contains a name of an image, star.png
`order` contains something link `links` DESC.
table: links_links

Field      Type       Null      Default       Links to      Comments      MIME
id         int(11)    No                         
name       text       Yes       NULL                   
url        text       Yes       NULL                   
title_tag  text       No                         
category   int(11)    Yes       NULL                   
target     text       Yes       NULL                   
image      text       No                         
show       int(1)     Yes       NULL                   
hits       int(100)   No                         
added      int(10)    No

`name` contains the name of the link
`url` contains the url of a site
`target` contains either _blank or _self

I was wondering, which is faster!
is it best to leave it all as text or is it better to go with varchar.

anyone has any thoughts about it.