Welcome, Guest. Please Login or Register.
May 14, 2025, 03:47:30 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Archive System « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Archive System  (Read 774 times)
Valconeye
Full Member
***
Posts: 190


Archive System
« on: July 16, 2003, 05:22:05 AM »
Reply with quote

an archive system of news.php, kind of what i have done here, but A LOT better, http://www.warcraftwars.com/?link=archives
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Archive System
« Reply #1 on: July 16, 2003, 07:06:14 AM »
Reply with quote

shouldn't be hard to make an archieve section
just make a new news_template.php, only showing the title, poster and date
then when calling the url, use ;limit=0,5
and the link for next page: ;limit=5,5... etc
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Valconeye
Full Member
***
Posts: 190


Re:Archive System
« Reply #2 on: July 16, 2003, 08:03:30 AM »
Reply with quote

limit0,5 limit5,5 ?? i can do that? lol thanks
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Archive System
« Reply #3 on: July 17, 2003, 12:46:21 AM »
Reply with quote

*smacks head*

I went through all the trouble of... of..... well, you can't do that in 1.6.0, anyhow, because it makes sure it's a number... or, at least, it had better.

-[Unknown]
Logged
Valconeye
Full Member
***
Posts: 190


Re:Archive System
« Reply #4 on: July 17, 2003, 06:35:47 PM »
Reply with quote

i made a few changes to news.php and made a small little mod for lastest news or an example http://wow-news.net headlines, its not much  :-\

<?
/*****************************************************************************/
/* News.php                                                                   */
/*****************************************************************************/
/* YaBB SE: Yet another Bulletin Board Splinter Edition                      */
/* Open-Source Project inspired by Zef Hemel ([email protected])              */
/* Software Version:           YaBB SE 1.5.1                                 */
/* Software by:                The YaBB SE Development Team                  */
/* ========================================================================= */
/* Software Distributed by:    http://www.yabbse.org                         */
/* Copyright 2001-2003 by:     http://www.lewismedia.com (Lewis Media)       */
/* Support, News, Updates at:  http://www.yabbse.org/community               */
/* Inspired and Ported From:   http://www.yabbforum.com                      */
/*****************************************************************************/
/* This program is free software; you may redistribute it and/or modify it   */
/* under the terms of the provided license as published by Lewis Media.      */
/*                                                                           */
/* This program is distributed in the hope that it will be useful, but       */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the provided    */
/* license for more information.                                             */
/*                                                                           */
/* See license.txt for details of the YaBB SE license. The latest version    */
/* of this license can be found at the distributor's site seen above.        */
/*****************************************************************************/

$newsphpver = 'YaBB SE 1.5.2';
$i = '0';

global $scripturl, $db_prefix, $txt, $db_name, $db_server, $db_user, $db_passwd, $cgi, $imagesdir, $board, $limit, $template, $ext, $locale, $timeformatstring;

if (!defined('YaBBSE'))
   die('Hacking attempt...');

$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db ($db_name);

$types_to_register = array('GET', 'POST', 'COOKIE', 'SESSION', 'SERVER');
foreach ($types_to_register as $type)
{
   $arr = @${'HTTP_' . $type . '_VARS'};
   if (@count($arr) > 0)
      extract($arr, EXTR_OVERWRITE);
}

if(!defined('LC_TIME'))
   define('LC_TIME', 'LC_TIME');
setlocale (LC_TIME, $locale);

if ($limit == null)
   $limit = 5;

if ($board == null)
{
   print 'No Board Specified!';
   exit;
}

$request = mysql_query("SELECT t.*,b.*,c.* FROM {$db_prefix}topics as t,{$db_prefix}boards as b,{$db_prefix}categories as c WHERE (b.ID_CAT=c.ID_CAT && c.memberGroups='' && b.ID_BOARD=$board)");
if (mysql_fetch_array($request) == null)
{
   print 'You can not display a board that is in a category with MemberGroups or the board ID does not exist. Please check the board number before trying again.';
   exit;
}

$request = mysql_query("SELECT t.*,m.* FROM {$db_prefix}topics as t, {$db_prefix}messages as m WHERE (t.ID_BOARD=$board && m.ID_MSG=t.ID_FIRST_MSG) ORDER BY m.posterTime DESC LIMIT $limit");

define('YaBBSE_news', 1);

while ($row = mysql_fetch_array($request))
{
   $news_a = $i++;
   $news_icon = '<img src="' . $imagesdir . '/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" />';
   $news_title = $row['subject'];
   $news_date = strftime($timeformatstring, $row['posterTime']);
   $news_tmp = $row['posterName'];
   $request2 = mysql_query("SELECT realName FROM {$db_prefix}members WHERE (memberName='$news_tmp') LIMIT 1");
   if ($tmp = mysql_fetch_array($request2))
      $news_poster = '<a href="' . $scripturl . '?action=viewprofile;user=' . $row['posterName'] . '">' . $tmp['realName'] . '</a>';
   else
      $news_poster = $news_tmp;

   $news_body = DoUBBC($row['body']);
   $news_checkcomment = ($row['numReplies'] == 1) ? $txt['yse_news_1'] : $txt['yse_news_2'];
   $news_comments = '<a href="' . $cgi . ';action=display;threadid=' . $row['ID_TOPIC'] . ';start=0">' . $row['numReplies'] . ' ' . $news_checkcomment . '</a>';
   $news_newcomment = '<a href="' . $cgi . ';action=post;threadid=' . $row['ID_TOPIC'] . ';title=Post+reply;start=' . $row['numReplies'] . '">' . $txt['yse_news_3'] . '</a>';
   $news_link = '<a href="' . $cgi . ';action=display;threadid=' . $row['ID_TOPIC'] . ';start=0">' . $news_title . '</a>';
   $news_recent = '<a href="http://www.warcraftwars.com/?link=news#' . $news_a . '">' . $news_title . '</a>';
   if ($template == null || !is_file($template . '.' . ($ext == null ? 'php' : $ext)))
      include('news_template.php');
   else
   {
      if ($ext == null)
         include($template . '.php');
      else
         include($template . '.' . $ext);
   }
}
exit;
?>
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Archive System
« Reply #5 on: July 17, 2003, 06:54:10 PM »
Reply with quote

* Spaceman-Spiff is writing a simple news archieve mod
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Archive System
« Reply #6 on: July 17, 2003, 08:23:06 PM »
Reply with quote

hmm...
just found out there are lots of optimization that can be done in News.php, which, i'm guessing, are going to be done in 1.6.0

anyway, i did a news archieve mod including template support
here're some examples:
http://www.mangadownloads.org/?page=archive
http://www.mangadownloads.org/?page=archive2
if anyone is interested, i'll release it as a mod

maybe i should make it in multiple pages based on year (for big websites with lotsa news)
« Last Edit: July 18, 2003, 07:01:26 PM by Spaceman-Spiff » Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Valconeye
Full Member
***
Posts: 190


Re:Archive System
« Reply #7 on: July 18, 2003, 01:48:04 AM »
Reply with quote

i am interested  ;D
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Archive System
« Reply #8 on: July 18, 2003, 07:01:50 PM »
Reply with quote

Mod released: http://www.yabbse.org/community/index.php?thread=24811
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Archive System « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.013 seconds with 17 queries.