Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
andrej
Hangin' Around


Joined: Sep 10, 2005
Posts: 48

PostPosted: Fri Jan 13, 2006 1:01 am Reply with quote

Hello !

I certain blocks and modules, the day / date names, format is being set by the function $locale.
The problem is that my webhost does not currently have my locale.
Since this webvsite is going to be in one language only, i don't really need the locale function.
I saw that in certain modules, the day names are being defined by these arrays.

I believe there is a method to replace the $locale function with an array of day names, however due to lack of coding skills i have rather decided to ask if there is any generally applicable method of replacement, or should it be block to block specific ( currently old news module and kalender module use it ).

Thanks for all your help !

i appriciate it !
 
View user's profile Send private message
andrej
PostPosted: Sat Jan 14, 2006 4:15 am Reply with quote

just wanted to place the sample code to get the idea..
I would like to replace the $locale part, with an array of dates if that's possible ?

Code:


<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;


getusrinfo($user);
if ($multilingual == 1) {
    if ($categories == 1) {
       $querylang = "where catid='$cat' AND (alanguage='$currentlang' OR alanguage='')";
    } else {
       $querylang = "where (alanguage='$currentlang' OR alanguage='')";
   if ($new_topic != 0) {
       $querylang .= " AND topic='$new_topic'";
   }
    }
} else {
    if ($categories == 1) {
      $querylang = "where catid='$cat'";
    } else {
   $querylang = "";
   if ($new_topic != 0) {
       $querylang = "WHERE topic='$new_topic'";
   }
    }
}
if (isset($userinfo['storynum']) AND $user_news == 1) {
    $storynum = $userinfo['storynum'];
} else {
    $storynum = $storyhome;
}
$boxstuff = "<table border=\"0\" width=\"100%\">";
$boxTitle = _PASTARTICLES;
$sql = "SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum";
$result = $db->sql_query($sql);
$vari = 0;

        // Quake - start
          if (!isset($mode) OR empty($mode)) {
            if(isset($userinfo['umode'])) {
              $mode = $userinfo['umode'];
            } else {
              $mode = "thread";
            }
          }
          if (!isset($order) OR empty($order)) {
            if(isset($userinfo['uorder'])) {
              $order = $userinfo['uorder'];
            } else {
              $order = 0;
            }
          }
          if (!isset($thold) OR empty($thold)) {
            if(isset($userinfo['thold'])) {
              $thold = $userinfo['thold'];
            } else {
              $thold = 0;
            }
          }
$r_options = "";
$r_options .= "&amp;mode=".$mode;
$r_options .= "&amp;order=".$order;
$r_options .= "&amp;thold=".$thold;
// Quake - end

while (list($sid, $title, $time, $comments) = $db->sql_fetchrow($result)) {
    $sid = intval($sid);
    $title = stripslashes($title);
    $see = 1;
    setlocale($locale);
    ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime2);
    $datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
    $datetime2 = ucfirst($datetime2);
    if ($articlecomm == 1) {
   $comments = "(".$comments.")";
    } else {
   $comments = "";
    }
    if($time2==$datetime2) {
        $boxstuff .= "<tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
    } else {
        if(empty($a)) {
           $boxstuff .= "<tr><td colspan=\"2\"><b>$datetime2</b></td></tr><tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
       $time2 = $datetime2;
       $a = 1;
   } else {
       $boxstuff .= "<tr><td colspan=\"2\"><b>$datetime2</b></td></tr><tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
       $time2 = $datetime2;
   }
    }
    $vari++;
    if ($vari==$oldnum) {
   if (isset($userinfo['storyhome'])) {
       $storynum = $userinfo['storyhome'];
   } else {
       $storynum = $storyhome;
   }
   $min = $oldnum + $storynum;
   $dummy = 1;
    }
}

if ($dummy == 1 AND is_active("Stories_Archive")) {
    $boxstuff .= "</table><br><a href=\"archive.html\"><b>"._OLDERARTICLES."</b></a>\n";
} else {
    $boxstuff .= "</table>";
}

if ($see == 1) {
    $content = $boxstuff;
}

?>
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©