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

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

0 Members and 1 Guest are viewing this topic.

Offline earthlyk

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #45 on: March 27, 2005, 10:39:00 AM »
I have found a temporary solution maybe it will help to solve the problem, here are my code :


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

$newstype = $_GET["newstype"];     //I add this line.

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

  $additional_sql = "";
  $additional_sql_2  = ""; //and add this line too.

-------------------------------------------------------------------------------------------------

then it work, but still have error message(same above post), so I set PHP.ini to display_errors = Off

earthlyk

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Latest News and Archive
« Reply #46 on: April 09, 2005, 04:45:09 AM »
Is there a way to show for example 3 comments (news) in home.html and 10 in the archive.html?

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Latest News and Archive
« Reply #47 on: May 20, 2005, 08:44:41 PM »
Hello!

I was corrected by Vano not to post once more in troubleshooting forum.
So i hope finally could someone help me what to do in my case.
Posting LATEST NEWS works :) BUT

My prob is:
the NEWS ARCHIVE Link does not work for me as you can see on www.industrie-gravuren.de/galerie  :(

I followed the suggest in the instruction to copy the home.html and to rename it as archive.html
But I cannot see the archive. Whats my mistake?

Here is the code of my Data files:

HOME-HTML:

{header}
 <tr>
 <td>
 <?php
 $tu = "{template_url}";
 $us = "{url_search}";
 $ls = "{lang_search}";
 $las = "{lang_advanced_search}";
 require "{template_url}/incl/searchbox.php";
 ?>
 </td>
 </tr>
 <tr>
 <td class="bordercolor">
 <table width="100%" border="0" cellspacing="1" cellpadding="0">
 <tr>
 <td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<?php
 $ub = '{user_box}';
 $lru = "{lang_registered_user}";
 require "{template_url}/incl/user_incl.php";
 ?>
{if random_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20" background="{template_url}/images/top_bg.gif"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
<br />
{random_image}
<br />
<br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_image}
<img src="{template_url}/images/spacer.gif" alt="" width="150" height="1" />
<?php
require "{template_url}/incl/menu.php";
?>
</td>
 <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
 <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
 <td width="100%" valign="top">
<?php
 $uti = "{url_top_images}";
 $lti = "{lang_top_images}";
 $uni = "{url_new_images}";
 $lni = "{lang_new_images}";
 require "{template_url}/incl/click_incl.php";
 ?>
  <br />
  <span class="title">{site_name}</span>
<hr size="1" />
  {if categories}
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td class="head1">
   <table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td class="head1" valign="top" background="{template_url}/images/top_bg.gif">{lang_categories}</td>
    </tr>
    <tr>
    <td class="row2" valign="top">{categories}</td>
    </tr>
   </table>
   </td>
   </tr>
  </table>
  <br />
  {endif categories}
 {lang_site_stats}<br />
   {if msg}<b>{msg}</b><br /><br />{endif msg}
  <br />
<?php
 $ni='{new_images}';
 require "{template_url}/incl/new_incl.php";
?>
 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td>{category_dropdown_form}</td>
   <td align="right">{setperpage_dropdown_form}</td>
   </tr>
  </table>
 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td align="left"  class="head1" valign="top" background="{template_url}/images/top_bg.gif" height="20" width="100%"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" /><a href="./index.php">Latest News</a></td>
    </tr>
    <tr>
        <td>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        {news_comments}
        </table>
        </td>
    <tr>
    <tr>
        <td align="right" class="head1" height="20" width="100%"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" /><a href="./index.php?newstype=latestnewsall">News Archive</a>&nbsp;&nbsp;</td>
    </tr>
</table>

 <br />
{whos_online}
 <br />

<?php
 require "{template_url}/incl/t_close.php";
?>
</td>
</tr>
<tr>
<td>
<?php
 require "{template_url}/incl/bott_incl.php";
?>
</td>
</tr>
</table>
{footer}

news_comment_Bit.html :

<tr>
   <td class="head1" ><div align="right"><small>{news_comment_date}</small></div><b>{news_comment_headline}</b></td>
</tr>
<tr>
   <td class="imagerow2" align="left">{news_comment_text}</td>
</tr>

index.php :

<?php

$templates_used = 'home,category_bit,whos_online,thumbnail_bit';
$main_template = 'home';

define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();

if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
  if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
    $template = "";
  }
  else {
    $main_template = $template;
  }
}
else {
  $template = "";
}
include(ROOT_PATH.'includes/page_header.php');

if (!empty($template)) {
  $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));
  $site_template->register_vars("clickstream", $clickstream);
  if ($news_type == "latestnewsall") { 
  $site_template->print_template($site_template->parse_template(archive));     

else { 
  $site_template->print_template($site_template->parse_template($main_template)); 
}
  include(ROOT_PATH.'includes/page_footer.php');
}

$cache_id = create_cache_id(
  'cat.page.index',
  array(
    $user_info[$user_table_fields['user_id']],
    isset($user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 0, 8) : 0,
    $config['template_dir'],
    $config['language_dir']
  )
);

if (!$cache_page_index || !$content = get_cache_file($cache_id)) {
// Always append session id if cache is enabled
if ($cache_page_index) {
  $old_session_mode = $site_sess->mode;
  $site_sess->mode = 'get';
}

ob_start();

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
  $imgtable_width .= "%";
}

$additional_sql = "";
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}

$num_new_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $new_images .= $lang['no_new_images'];
  $new_images .= "</td></tr></table>";
}
else  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($image_row);
    $new_images .= $site_template->parse_template("thumbnail_bit");
    $new_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $new_images .= "</tr>\n";
    }
  }
  $new_images .= "</table>\n";
} // end else

$site_template->register_vars("new_images", $new_images);
unset($new_images);

//--------------------------------------------------------
// 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 = "1";      // 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 = "3";    // Number of news articles to show ....
                                // .... change This to fixed number of articles to display for latest news
                               
  $news_image = "240";          // 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
            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
            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']),
            "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   -------------------------------
//-----------------------------------------------------

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream
));
if ($news_type == "latestnewsall") { 
  $site_template->print_template($site_template->parse_template(archive));     

else { 
  $site_template->print_template($site_template->parse_template($main_template)); 
}

$content = ob_get_contents();
ob_end_clean();

if ($cache_page_index) {
  // Reset session mode
  $site_sess->mode = $old_session_mode;

  save_cache_file($cache_id, $content);
}

} // end if get_cache_file()

echo $content;

include(ROOT_PATH.'includes/page_footer.php');
?>

archive.html :

{header}
 <tr>
 <td>
 <?php
 $tu = "{template_url}";
 $us = "{url_search}";
 $ls = "{lang_search}";
 $las = "{lang_advanced_search}";
 require "{template_url}/incl/searchbox.php";
 ?>
 </td>
 </tr>
 <tr>
 <td class="bordercolor">
 <table width="100%" border="0" cellspacing="1" cellpadding="0">
 <tr>
 <td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<?php
 $ub = '{user_box}';
 $lru = "{lang_registered_user}";
 require "{template_url}/incl/user_incl.php";
 ?>
{if random_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20" background="{template_url}/images/top_bg.gif"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
<br />
{random_image}
<br />
<br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_image}
<img src="{template_url}/images/spacer.gif" alt="" width="150" height="1" />
<?php
require "{template_url}/incl/menu.php";
?>
</td>
 <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
 <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
 <td width="100%" valign="top">
<?php
 $uti = "{url_top_images}";
 $lti = "{lang_top_images}";
 $uni = "{url_new_images}";
 $lni = "{lang_new_images}";
 require "{template_url}/incl/click_incl.php";
 ?>
  <br />
  <span class="title">{site_name}</span>
<hr size="1" />
  {if categories}
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td class="head1">
   <table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td class="head1" valign="top" background="{template_url}/images/top_bg.gif">{lang_categories}</td>
    </tr>
    <tr>
    <td class="row2" valign="top">{categories}</td>
    </tr>
   </table>
   </td>
   </tr>
  </table>
  <br />
  {endif categories}
 {lang_site_stats}<br />
   {if msg}<b>{msg}</b><br /><br />{endif msg}
  <br />
<?php
 $ni='{new_images}';
 require "{template_url}/incl/new_incl.php";
?>
 <br />
{whos_online}
  <br />
  <table width="100%" border="1" cellspacing="1" cellpadding="1">
   <tr>
      <td align="left"  class="head1" height="20">Archived News</td>
                <td align="right" class="head1" height="20">{paging}></td>
   </tr>

   <tr>
      <td colspan="2">
         <table width="100%" border="1" cellspacing="1" cellpadding="4">
         {news_comments}
         </table>
      </td>
   </tr>
   <tr>
      <td align="left"  class="head1" height="20"> <a href="./index.php">Latest News</a></td>
      <td align="right" class="head1" height="20">{paging} </td>
   </tr>             
</table>

 
<?php
 require "{template_url}/incl/t_close.php";
?>
</td>
</tr>
<tr>
<td>
<?php
 require "{template_url}/incl/bott_incl.php";
?>
</td>
</tr>
</table>
{footer}

So i hope someone has a solution for me.

Many thanks for helping me :cry:

drhtm

  • Guest
Re: [Mod] Latest News and Archive
« Reply #48 on: May 27, 2005, 12:48:56 PM »
Is there a way to show for example 3 comments (news) in home.html and 10 in the archive.html?

I agree.  This mod would be 10x better with this added feature.  For my site, I like to add one news headline but then when you click to see more news, it only shows one news per page  :x

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #49 on: May 27, 2005, 02:37:19 PM »
hi ascanio, hi drhtm, hi all ...

Quote
Is there a way to show for example 3 comments (news) in home.html and 10 in the archive.html ?

yes ...  :!: ... here we go :

Step 1.
open index.php and find in [MOD] Latest and Archive News :
Code: [Select]
$show_news_articles = "5";    // Number of news articles
                                // .... change This to fixed number of articles to display for latest news

and replace with :
Code: [Select]
$show_news_articles = "3";    // Number of news articles to show in index ....
                                // .... change This to fixed number of articles to display for latest news

$show_news_articles_archive = "10";    // Number of news articles to show in archive ....
                                // .... change This to fixed number of articles to display for latest news

Step 2.
then find in index.php in [MOD] Latest and Archive News :
Code: [Select]
$perpage = $show_news_articles;

and replace with :
Code: [Select]
$perpage = $show_news_articles_archive;

thats all ...  :wink: ...
this modificaton works since some time in the best way on my page ... :D ...
and now (drhtm) is the [Mod] Latest News and Archive 10x better ...  :wink: ...

thanks again to Fugaziman for this great MOD

mawenzi


Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Latest News and Archive
« Reply #50 on: May 27, 2005, 05:30:06 PM »
thanks a lot :)

drhtm

  • Guest
Re: [Mod] Latest News and Archive
« Reply #51 on: May 27, 2005, 11:39:06 PM »
wow that was easy...thanks!

Offline pkitty

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #52 on: July 18, 2005, 03:36:06 AM »
Okay, I added this mod, one problem, for some reason, I am not getting a comment box on the image I uploaded and I dont know why....*shakes head*

I am having a hard time figuring this out....The latest news banner is showing, and the archive, well, lets just say I wasnt sure what to take out of the home.html so its just a blank page, but thats okay...please help??


Offline pkitty

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #53 on: July 18, 2005, 11:53:06 PM »
Kay, been a day, does anybody have a solution as to why I am not getting a comment box on my news Image in the latest news folder?  No?

TheOracle

  • Guest
Re: [Mod] Latest News and Archive
« Reply #54 on: July 19, 2005, 01:25:29 PM »
How about sending a captured image to see more clairly what you mean ?

Perhaps it is due to a bad implementation by following the instructions during the process ? ;)

Offline pkitty

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [Mod] Latest News and Archive
« Reply #55 on: July 20, 2005, 05:41:15 PM »
How about sending a captured image to see more clairly what you mean ?

Perhaps it is due to a bad implementation by following the instructions during the process ? ;)

Well, went back and double checked the code, made sure all was put in where it needed to be and what not, because I am not that blonde.....Then I got to thinking, and deleted the original image and reuploaded it, then changed the image ID and it is now working properly.  It could have been that the image was put in before I put in a certain part of the code, not sure.  But I figured it out and got it working.

TheOracle

  • Guest
Re: [Mod] Latest News and Archive
« Reply #56 on: July 20, 2005, 08:41:03 PM »
Quote

I am not that blonde


Well, if you admit yourself that way ... why not ? ! :mrgreen:

Quote

It could have been that the image was put in before I put in a certain part of the code, not sure.


Thx for pointing this out. This will be useful for other users in the future. ;)

Offline karimun

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • http://www.at6pm.com
Re: [Mod] Latest News and Archive
« Reply #57 on: July 24, 2005, 10:43:19 PM »
Is there a way of only displaying the title when visitors are logged out and when they log in to show the full post?

I use this MOD at a site where confidential data gets posted in the news section. It would be great to hide the actual news block from non-members ..


TheOracle

  • Guest
Re: [Mod] Latest News and Archive
« Reply #58 on: July 24, 2005, 10:45:16 PM »
Quote

Is there a way of only displaying the title when visitors are logged out and when they log in to show the full post?


Outstanding idea. I will try this out right now. ;)

TheOracle

  • Guest
Re: [Mod] Latest News and Archive
« Reply #59 on: July 24, 2005, 11:11:28 PM »
Ok, let's try this.

In your index.php file,

find :

Quote

$news .= multilang(format_text($image_row['news_text']), ((isset($config['news_html']))?$config['news_html']:0), 0, ((isset($config['news_bbcode']))?$config['news_bbcode']:1), ((isset($config['news_bbcodeimg']))?$config['news_bbcodeimg']:1));


replace with :

Code: [Select]

$news .= ($user_info['user_level'] != USER ? "" : multilang(format_text($image_row['news_text']), ((isset($config['news_html']))?$config['news_html']:0), 0, ((isset($config['news_bbcode']))?$config['news_bbcode']:1), ((isset($config['news_bbcodeimg']))?$config['news_bbcodeimg']:1)));


Note: I have installed the multilang MOD at that time. If you did not installed this MOD,

find :

Quote

$news .= format_text($image_row['news_text']), ((isset($config['news_html']))?$config['news_html']:0), 0, ((isset($config['news_bbcode']))?$config['news_bbcode']:1), ((isset($config['news_bbcodeimg']))?$config['news_bbcodeimg']:1));


simply replace with :

Code: [Select]

$news .= ($user_info['user_level'] != USER ? "" : format_text($image_row['news_text']), ((isset($config['news_html']))?$config['news_html']:0), 0, ((isset($config['news_bbcode']))?$config['news_bbcode']:1), ((isset($config['news_bbcodeimg']))?$config['news_bbcodeimg']:1)));


Is that what you were looking for to do ? ;)