• [MOD]Another Simple News Publishing Mod 5 0 5 1
Currently:  

Author Topic: [MOD]Another Simple News Publishing Mod  (Read 348835 times)

0 Members and 1 Guest are viewing this topic.

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #45 on: August 08, 2005, 03:52:47 PM »
Quote

Is there any mod that adds a similar block to the left sidebar? Like "Links" block


Quote

Links ... you mean like : "Headlines" ?


Quote

Yes, but small and in the left sidebar


You said : ' yes ' for the ' headlines '. How could I have misunderstood your request if you claimed that this is what you were looking for ? Please be more specific in the future since, it would seems, the headlines was ' not ' what you wanted in the first place.

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #46 on: August 11, 2005, 04:53:52 PM »
Hi to all,

maybe who know, why i see blank page in news.php, when i click on the "Arhive" ?
I dont see news archive there :/

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #47 on: August 11, 2005, 05:05:21 PM »
I can only think that you made a mistake during the addition of the paragraph for index.php file or the creation of your news.php file from the root path. Otherwise, I don't see how this can happend. Did you modified the files permissions as well after making these modifications ? It might simply not be high enough. ;)

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #48 on: August 11, 2005, 05:14:58 PM »
Whitch files must be with 777 or something....
 permissions?

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #49 on: August 11, 2005, 05:23:26 PM »
Most particularly your news.php file, yes.

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #50 on: August 11, 2005, 05:25:56 PM »
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/mysite/images/index.php on line 130
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/mysite/images/index.php on line 130



There is:
"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php"\" class=\"link\">".$lang['news_archive']."</a>",


TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #51 on: August 11, 2005, 05:29:58 PM »
Makes sense to me :

Quote

"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php"\" class=\"link\">".$lang['news_archive']."</a>",


should be :

Code: [Select]

"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php")."\" class=\"link\">".$lang['news_archive']."</a>",


Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #52 on: August 11, 2005, 05:45:08 PM »
thank's, index.php at now work good, but in the news.php there is no archive :/

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #53 on: August 11, 2005, 06:01:43 PM »
Did you configured your ACP - > Settings - > news settings ? Also, did you posted a news yet ? ;)

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #54 on: August 11, 2005, 06:43:19 PM »
at the index.php i see my news, but in news.php i didn't see anything

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #55 on: August 11, 2005, 06:48:08 PM »
Quote

i didn't see anything


Didn't. So, now it's fixed ?

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #56 on: August 11, 2005, 07:22:44 PM »
My news.php file:
Code: [Select]

<?php

$main_template 
'register';
define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

//-----------------------------------------------------
//---Show Guestbook Comments---------------------------
//-----------------------------------------------------

if (isset($_POST['commentsetperpage']) || isset($_GET['commentsetperpage']))
{
$commentsetperpage = (intval($_POST['commentsetperpage']) ) ? intval($_POST['commentsetperpage']) : intval($_GET['commentsetperpage']);
if ($commentsetperpage)
{
$site_sess->set_session_var("commentperpage"$commentsetperpage);
$session_info['commentperpage'] = $commentsetperpage;
}
}

if (isset($session_info['commentperpage']))
{
$newsPerPage $session_info['commentperpage'];
} else
{
$newsPerPage 5;
}

$sql "SELECT COUNT(news_id) AS news FROM ".NEWS_TABLE;
$result $site_db->query_firstrow($sql);
$num_news $result['news'];
$site_db->free_result();

$num_rows_all = (isset($num_news)) ? $num_news 0;

$link_arg $site_sess->url(ROOT_PATH."news.php");
include_once(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page$newsPerPage$num_rows_all$link_arg);

$offset $getpaging->get_offset();

$site_template->register_vars(array(
    "paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));

$sql "SELECT news_id, news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT $offset$newsPerPage";

$result $site_db->query($sql);
$news_row = array();
while ($row $site_db->fetch_array($result))
{
$news_row[] = $row;
}
$site_db->free_result($result);
$num_news sizeof($news_row);
$comments "";

if ($num_news)
{
for ($i 0$i $num_news$i++)
{
$comment_user_name htmlspecialchars($news_row[$i]['comment_user_name']);

$admin_links "";
if ($user_info['user_level'] == ADMIN)
{
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/news.php?action=editnews&amp;news_id=".$news_row[$i]['news_id'])."\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/news.php?action=removenews&amp;news_id=".$news_row[$i]['news_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>";
}

$site_template->register_vars(array(
    "news_title" => "<b>".$news_row[$i]['news_title']."</b>".sprintf($lang['news_posted_by'], $news_row[$i]['user_name'], format_date($config['date_format']." ".$config['time_format'], $news_row[$i]['news_date'])),
"news_text" => format_text($news_row[$i]['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)),
"admin_links" => $admin_links,
));
$comments .= $site_template->parse_template("news_bit");
// end for
}
else
{
$comments $lang['no_news'];
}

//---End Show Guestbook Comments----

$contents $site_template->parse_template("news_show");

  $txt_clickstream $lang['news_main'];

//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];

if (
$getpaging->page 1)
{
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."news.php")."\">".$lang['news_main']."</a>".$config['category_separator'].$lang['page']." ".$getpaging->page."</span>";
}
else
$clickstream .= $txt_clickstream."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "contents" => $contents,
  "news_contents" => $comments,
  "lang_register" => $lang['news'],
  "clickstream" => $clickstream
));
unset(
$contents);
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');

?>



Permissions 777

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #57 on: August 11, 2005, 08:26:45 PM »
As stupid as it looks, do you have an empty space above the <?php mark ?

Quote

<?php


It looks like you have one. Am I right ? ;)

And below the : ?> mark, do you have empty spaces as well ?

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #58 on: August 11, 2005, 09:00:23 PM »
No, only there is spaces in (code) (/code)
in real script no spaces...

my news.php script work, but there is empty place, no news archive, where must be info...
i don't know where is problem :/

TheOracle

  • Guest
Re: [MOD]Another Simple News Publishing Mod
« Reply #59 on: August 11, 2005, 09:03:38 PM »
URL ?