• [Mod] Latest News and Archive 5 0 5 1
Currently:  

Author Topic: [Mod] Latest News and Archive  (Read 182442 times)

0 Members and 2 Guests are viewing this topic.

Offline weezle

  • Newbie
  • *
  • Posts: 15
    • View Profile
[Mod] Latest News and Archive
« Reply #30 on: May 22, 2003, 11:40:52 PM »
New Problem...

http://www.bleischter-suffkoepp.de/4images/index.php

if your are looking on my suite,
you will see, there is on the left side an free place,
you know, how i can change the side of my news..?

if i am logged on, there wasnt this failure...whats happend?

Thx for help again


Greetings
Marco

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Latest News and Archive
« Reply #31 on: May 23, 2003, 01:23:56 AM »
check your user_loginform.html template
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline weezle

  • Newbie
  • *
  • Posts: 15
    • View Profile
[Mod] Latest News and Archive
« Reply #32 on: May 23, 2003, 02:19:01 PM »
<table width="100%" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td valign="top" align="left">
      <form action="{url_login}" method="post">
        {lang_user_name}<br />
        <input type="text" size="10" name="user_name" class="logininput" />
        <br />
        {lang_password}<br />
        <input type="password" size="10" name="user_password" class="logininput" />
        <br />
        <table border="0" cellspacing="0" cellpadding="0">
          <tr valign="top">
            <td><input type="checkbox" name="auto_login" value="1" /></td>
            <td><span class="smalltext">{lang_auto_login}</span></td>
          </tr>
        </table>
        <br />
      <input type="submit" value="{lang_login}" class="button" />
      </form>
      &raquo; <a href="{url_lost_password}">{lang_lost_password}</a><br />
     &raquo; <a href="{url_register}">{lang_register}</a></td>
  </tr>
</table>
 



that is my user_loginform.html, but i wont find a failure.....
normally i have to change the home.html or?

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Latest News and Archive
« Reply #33 on: May 23, 2003, 05:00:20 PM »
Looks like a problem with your home.html file.
perhaps a missing <tr> or <td>

Fugaziman
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline tmacisnbr1

  • Newbie
  • *
  • Posts: 32
    • View Profile
[Mod] Latest News and Archive
« Reply #34 on: May 30, 2003, 05:25:30 AM »
Is there a way to make it so that it shows the name of the user that posted the comment in the news header?

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Latest News and Archive
« Reply #35 on: May 31, 2003, 04:32:28 PM »
Quote from: tmacisnbr1
Is there a way to make it so that it shows the name of the user that posted the comment in the news header?


I haven't tested this but it should work.....

Replace Step7 with this code
Code: [Select]
//--------------------------------------------------------
// Latest and Archive News Mod            --
//                     --
// User configurable variables            --
// You must change the first 4 variables to meet   --
// your requirements:     (see notes below)      --
//     $display_by_count            --
//     $latest_news_day               --
//     $show_news_articles            --
//     $news_image               --
//--------------------------------------------------------
  $display_by_count = "0";      // values 0 or 1 ....
                                // .... change this to 0 if display by days posted
                                // .... or 1 to display fixed number of news articles as Latest
                               
  $latest_news_days = "31";     // Number of days news displays at Latest ....
                                // .... change This to the number of days news shows as Latest
                               
  $show_news_articles = "5";    // Number of news articles to show ....
                                // .... change This to fixed number of articles to display for latest news
                               
  $news_image = "*****";          // Change This to your Latest news image id
//----------------------------------------------------

$new_news = (time() - 60 * 60 * 24 * $latest_news_days);

if ($newstype == "latestnewsall"){
    $news_type = "latestnewsall";
    }
else {
    $news_type = "latestnews";
    }

  $additional_sql = "";

  if ($news_type == "latestnews") {

    if ($display_by_count) {
        $additional_sql .= "  c.image_id = '".$news_image."'";
        $additional_sql_2 .= " LIMIT ".$show_news_articles;
    }
    else {
        $additional_sql .= " c.comment_date > '".$new_news."' AND c.image_id = '".$news_image."'";
        $additional_sql_2 .= "";
    }
  }

  else {
    $additional_sql .= " c.image_id = '".$news_image."'";
    $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>&nbsp;/&nbsp;Archived News";
  }

  $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id, c.user_name
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2 ;

  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  $news_comment_row = array();

  while ($row = $site_db->fetch_array($result)) {
    $news_comment_row[] = $row;
  }

  $site_db->free_result($result);
   
// This is the Paging stuff
  if ($newstype == "latestnewsall") {
       
    include(ROOT_PATH.'includes/paging.php');
    $perpage = $show_news_articles;
    $link_arg = $site_sess->url(ROOT_PATH."index.php?newstype=latestnewsall");
    $getpaging = new Paging($page, $perpage, $num_rows, $link_arg);
    $offset = $getpaging->get_offset();

    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
      "paging_stats" => $getpaging->get_paging_stats()
    ));
     
    $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id, c.user_name
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2."  
            LIMIT $offset, $perpage";

          $result = $site_db->query($sql);
          $num_rows = $site_db->get_numrows($result);
          $news_comment_row = array();
           
      while ($row = $site_db->fetch_array($result)) {
            $news_comment_row[] = $row;
          }
  }

  if (!$num_rows) {
      $news_comments = "&nbsp;&nbsp;&nbsp;<b>No New News to report within the last ".$latest_news_days." days.</b>";
  }
  else {
      $news_comments = "";
      $bgcounter = 0;

    for ($i = 0; $i < $num_rows; $i++) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

        $site_template->register_vars(array(
            "news_comment_headline" => format_text($news_comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
            "news_comment_text" => format_text($news_comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
            "news_comment_date" => format_date($config['date_format']." ".$config['time_format'], $news_comment_row[$i]['comment_date']),
            "news_comment_name" => $news_comment_row[$i]['user_name'],
            "row_bg_number" => $row_bg_number));

        $news_comments .= $site_template->parse_template("news_comment_bit");
    }

  }
  $site_template->register_vars("news_comments", $news_comments);
  unset($news_comments);

//-----------------------------------------------------
//---End of Show Latest News   -------------------------------
//-----------------------------------------------------



Then in the news_comment_bit.html you created add
Code: [Select]
{news_comment_name} Where you want the username to appear.

Good luck
Fugaziman
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline tmacisnbr1

  • Newbie
  • *
  • Posts: 32
    • View Profile
[Mod] Latest News and Archive
« Reply #36 on: May 31, 2003, 06:31:44 PM »
Thank you so much!!!

Offline aymanati

  • Full Member
  • ***
  • Posts: 214
    • View Profile
    • http://lqta.com
[Mod] Latest News and Archive
« Reply #37 on: June 06, 2003, 03:17:27 PM »
I think this is very stupid, but how could I know the image id ?  :oops:

I tried to look for it in the file manager but didn't find it...

help me in that please.

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Latest News and Archive
« Reply #38 on: June 06, 2003, 04:19:43 PM »
Quote from: aymanati
I think this is very stupid, but how could I know the image id ?  :oops:
quote]

IOf you mean the image_id of the Latest_News image you created in step1 then the easiest way is to...
log into your site as the administrator.
Find your Latest News image
Click on it to bring up the Details page
Look at the URL/Address line in the browser and you should see something like image_id=****

That's your Lates News image ID.

Hope that Helps
Fugaziman  8)
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline aymanati

  • Full Member
  • ***
  • Posts: 214
    • View Profile
    • http://lqta.com
[Mod] Latest News and Archive
« Reply #39 on: June 07, 2003, 07:56:07 PM »
:)
thanks Fugaziman
it works



BUT the last modification



Quote
I haven't tested this but it should work.....

Replace Step7 with this code
Code: .......


didn't work.
It gives me this error:
Parse error: parse error, expecting `')'' in c:\apache\htdocs\gallery\index.php on line 243

any advice?

Offline aymanati

  • Full Member
  • ***
  • Posts: 214
    • View Profile
    • http://lqta.com
[Mod] Latest News and Archive
« Reply #40 on: June 07, 2003, 07:57:12 PM »
this was in line 243:

     "row_bg_number" => $row_bg_number));

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Latest News and Archive
« Reply #41 on: June 07, 2003, 08:31:35 PM »
Quote from: aymanati
this was in line 243:

     "row_bg_number" => $row_bg_number));


Oops ! Just noticed I missed a comma (,) at the end of this line

Code: [Select]
"news_comment_name" => $news_comment_row[$i]['user_name'],

See if that helps
Sorry but I still haven't had time to test this.
Fugaziman
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline aymanati

  • Full Member
  • ***
  • Posts: 214
    • View Profile
    • http://lqta.com
I'll try it
« Reply #42 on: June 10, 2003, 08:57:22 AM »
thanks man,

I'll try it and let you know.

Offline aymanati

  • Full Member
  • ***
  • Posts: 214
    • View Profile
    • http://lqta.com
[Mod] Latest News and Archive
« Reply #43 on: June 10, 2003, 04:45:50 PM »
it works ..
Thanks
:)

Offline earthlyk

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #44 on: March 27, 2005, 07:02:54 AM »
Hi, Fugaziman:

    First, thank you post this MOD, I have used this MOD with no problem by using WinXP+Easyphp 1.7 + 4images.

    Then, when I download a program call "Tenable NeWT Security Scanner" to scan my site, give me the result that my site had many holes. So I have to upgrade Easyphp1.7 to 1.8(apache 1.3.33 PHP 4.3.10 Mysql 4.1.9) and there comes some problem: one is this MOD, below are the message:

Notice: Undefined variable: newstype in ...\4images\index.php on line 184

Notice: Undefined variable: additional_sql_2 in ...\4images\index.php on line 197

I set PHP.ini register_globals = On (PHP 4.3.10 default is off) but still don't work.

I did not familiar with PHP coding, and it also painful for me to write English to ask help, BUT I have to, so if my expression didn't get well enough and let you could not understand what I mean just forget this post.

Sorry for my poor English and Thank you for reading my post.

earthlyk