4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vincent on July 27, 2005, 11:22:41 PM

Title: [MOD]Another Simple News Publishing Mod
Post by: Vincent on July 27, 2005, 11:22:41 PM
The Oracle found some errors which required modifications to the MOD. I updated it at 13:50 swisstime 28.07.2005 - thanks TheOracle!
## MOD Title: Another Simple News Publishing Mod
## MOD Author: janfy < janfy@cagades.com > http://www.cagades.com/
## MOD Description: Adds news to your 4images gallery
##
## MOD Version: 1.3.0

Reference:
http://www.4homepages.de/forum/index.php?topic=6787.msg29663#msg29663

##############################################################
## Before Adding This MOD To Your Gallery, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]---------------------------------
#
Code: [Select]
includes/constants.php
#
#-----[ FIND ]---------------------------------
#
Code: [Select]
define('LIGHTBOXES_TABLE', $table_prefix.'lightboxes');
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
define('NEWS_TABLE', $table_prefix.'news');
#
#-----[ OPEN ]---------------------------------
#
index.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
unset($categories);
#
#-----[ AFTER, ADD ]------------------------------------------
#

Code: [Select]
//-----------------------------------------------------
// ----- Show news ------------------------------------
//-----------------------------------------------------

if (!isset($config['news_home_display']) || $config['news_home_display'] == 1)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT 0, ".((isset($config['news_nb']))?$config['news_nb']:5);
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";

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

if (!$num_rows)  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $news .= $lang['no_news'];
  $news .= "</td></tr></table>";
}
else  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";

  while ($image_row = $site_db->fetch_array($result))
  {
    $news .= "<tr class=\"imagerow1\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n";
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
$news .= "<b>".$image_row['news_title']."</b>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."</sup>":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";
    $news .= "</tr>\n";

    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
$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));
$news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";

  } // end while

  $news .= "</table>\n";
} // end else

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

#
#-----[ OPEN ]---------------------------------
#
admin/index.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
show_nav_option($lang['nav_comments_edit'], "comments.php?action=modifycomments");
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
show_nav_header($lang['news_main']);
show_nav_option($lang['news_add'], "news.php?action=addnews");
show_nav_option($lang['modify_news'], "news.php?action=modifynews");


#
#-----[ OPEN ]---------------------------------
#
lang/english/main.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
$lang['delete'] = "[Delete]";
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
$lang['news_main'] = 'News';
$lang['no_news'] = 'No news';
$lang['news_deleted'] = ' news deleted';
$lang['newss_deleted'] = ' news deleted';
$lang['news_deletion'] = 'News deletion';
$lang['newss'] = 'news';
$lang['news'] = 'news';
$lang['news_modified'] = 'News modified successfully.';
$lang['news_modified_nok'] = 'Error during news modification.';
$lang['news_deletion_confirmation'] = 'Do you really want to delete the %s selected news.';
$lang['edit_news_title'] = 'News #%d posted by %s';
$lang['news_title'] = 'Title';
$lang['news_content'] = 'Content';
$lang['news_date'] = 'Date';
$lang['modify_news'] = 'Edit news';
$lang['news_author'] = 'Author';
$lang['news_add'] = 'Add a news';
$lang['news_add_ok'] = 'News added successfully.';
$lang['news_posted_by'] = ' -- Posted by <b>%s</b> on <i>%s</i>';
$lang['news_archive'] = 'Archives';
$lang['page'] = 'Page';
#
#-----[ OPEN ]---------------------------------
#
lang/french/main.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
$lang['delete'] = "[Supprimer]";
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
$lang['news_main'] = 'Nouvelles';
$lang['no_news'] = 'Pas de nouvelle';
$lang['news_deleted'] = ' nouvelle supprimée';
$lang['newss_deleted'] = ' nouvelles supprimées';
$lang['news_deletion'] = 'Suppression de news';
$lang['newss'] = 'nouvelles';
$lang['news'] = 'nouvelle';
$lang['news_modified'] = 'Nouvelle modifiée avec succčs';
$lang['news_modified_nok'] = 'Erreur lors de la modification de la nouvelle.';
$lang['news_deletion_confirmation'] = 'Etes vous sur de vouloir supprimer la(les) %s nouvelle(s) sélectionnée(s)';
$lang['edit_news_title'] = 'Nouvelle #%d postée par %s';
$lang['news_title'] = 'Titre';
$lang['news_content'] = 'Contenu';
$lang['news_date'] = 'Date';
$lang['modify_news'] = 'Editer les nouvelles';
$lang['news_author'] = 'Auteur';
$lang['news_add'] = 'Ajouter une nouvelle';
$lang['news_add_ok'] = 'Nouvelle ajoutée avec succés.';
$lang['news_posted_by'] = ' -- Posté par <b>%s</b> le <i>%s</i>';
$lang['news_archive'] = 'Archives';
$lang['page'] = 'Page';

#
#-----[ OPEN ]---------------------------------
#
template/default/home.html

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
{whos_online}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
Code: [Select]
<table width="450" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="head1">
      <table width="100%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td class="head1">{news_main}</td>
          <td class="head1" align="right" height="20">{news_archives}</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head1" colspan="2">{news}</td>
  </tr>
</table>
<br />

#
#-----[ OPEN ]---------------------------------
#
lang/english/admin.php

#
#-----[ FIND ]---------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
Code: [Select]
/*-- Setting-Group 8 --*/
$setting_group[8] = "News";
$news_display_optionlist = array(
  "1" => "Show the last 'X' news",
  "2" => "Show news of the last 'X' days",
);

$setting['news_home_display'] = "News display mode";
$setting['news_nb'] = "News number";
$setting['news_nb_days'] = "Days number";
$setting['news_cutoff'] = "Number of days each news is marked as new";
$setting['news_html'] = "Allow HTML in news";
$setting['news_bbcode'] = "Allow BB-Code in news";
$setting['news_bbcodeimg'] = "Allow images (BB-Code) in news";
#
#-----[ OPEN ]---------------------------------
#
lang/french/admin.php

#
#-----[ FIND ]---------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
Code: [Select]
/*-- Setting-Group 8 --*/
$setting_group[8] = "Nouvelles";
$news_display_optionlist = array(
  "1" => "Afficher les 'X' derničres nouvelles",
  "2" => "Afficher les nouvelles des 'X' derniers jours",
);

$setting['news_home_display'] = "Mode d'affichage des nouvelles";
$setting['news_nb'] = "Nombre de nouvelles";
$setting['news_nb_days'] = "Nombre de jours";
$setting['news_cutoff'] = "Nombre de jours ou la nouvelle est considérée comme 'nouvelle'";
$setting['news_html'] = "Autoriser le HTML dans les nouvelles";
$setting['news_bbcode'] = "Autoriser le BB-Code dans les nouvelles";
$setting['news_bbcodeimg'] = "Autoriser les images (BB-Code) dans les nouvelles";
#
#-----[ OPEN ]---------------------------------
#
admin/settings.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
show_setting_row("highlight_admin", "radio");
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
show_table_separator($setting_group[8], 2, "#setting_group_8");
show_setting_row("news_home_display", "show_news_display_options");
show_setting_row("news_nb");
show_setting_row("news_nb_days");
show_setting_row("news_cutoff");
show_setting_row("news_html", "radio");
show_setting_row("news_bbcode", "radio");
show_setting_row("news_bbcodeimg", "radio");
#
#-----[ FIND ]---------------------------------
#
Code: [Select]
// end of functions
#
#-----[ BEFORE, ADD ]------------------------------------------
#
Code: [Select]
function show_news_display_options($setting_name, $setting_value) {
  global $news_display_optionlist;
  foreach ($news_display_optionlist as $key => $val) {
    echo "<input type=\"radio\" name=\"setting_item[".$setting_name."]\" value=\"$key\"";
    if ($setting_value == $key) {
      echo " checked=\"checked\"";
    }
    echo "> ".$val."<br />";
  }
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

#
#-----[ DATABASE UPDATE ]------------------------------------------
#

Open a web browser and open the page http://your_domain/4images_dir/install_news.php

and thanks a lot to theOracle which saved the 4images_news.zip file on his computer
TheOracle also have done a addon --> http://www.4homepages.de/forum/index.php?topic=9059
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on July 28, 2005, 01:35:42 PM
*** IMPORTANT BUG FOUND AND CORRECTED ABOVE. ***

For users who already installed this MOD yesterday, it is imperative that you make the following modifications from

your index.php file due to sessions issues from the archives page. This was the main reason why numerous users has reported a bug in that page in the past.

Find :

Quote

"news_archives" => $lang['news_archive'],


and strongly replace with :

Code: [Select]

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


Then, in your templates/<your_template>/home.html file,

find :

Quote

<td class="head1" align="right"><a class="head1" href="news.php">{news_archives}</a></td>


simply replace with :

Code: [Select]

<td class="head1" align="right" height="20">{news_archives}</td>

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: V@no on July 30, 2005, 06:41:56 PM
and strongly replace with :

Code: [Select]

"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php?sessionid=".$session_info['session_id'])."\" 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>",
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: pkitty on August 01, 2005, 10:10:38 PM
This is on the new mod is that correct posted by Vano? Not the older ones, right?   ....I dont seem to be having any issues, so do I need to change mine?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: V@no on August 02, 2005, 12:06:01 AM
This is on the new mod is that correct posted by Vano? Not the older ones, right? ....I dont seem to be having any issues, so do I need to change mine?
block the cookies and u'll see the issue: two sessionid in the url for news archive
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 02, 2005, 12:12:28 AM
Quote

block the cookies and u'll see the issue: two sessionid in the url for news archive


Since the answer above is now clean, modifications will be made above as the first post will be arranged shortly as well.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: pkitty on August 03, 2005, 01:26:21 AM
Okay, I went and did this....and I see that there is a news/edit news in the control panel, but when I click on it, I now get a huge list of weird errors....

this was the mod for news that I installed http://www.4homepages.de/forum/index.php?topic=5142.0  should I not have done that....  *shakes Head*
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 03, 2005, 01:54:50 AM
Quote

this was the mod for news that I installed http://www.4homepages.de/forum/index.php?topic=5142.0  should I not have done that....  *shakes Head*


These are two seperated MODs which must not be used together.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 03, 2005, 08:30:36 PM
How can I edit the text colors in the tag that is using {news}
I tried editing news_bit.html (works for the Archives) But news_show.html doesn't do anything. What am I doing wrong?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 03, 2005, 10:26:18 PM
Quote

How can I edit the text colors in the tag that is using {news}


These classes are located in index.php and news.php file.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 04, 2005, 11:31:00 AM
Quote

How can I edit the text colors in the tag that is using {news}


These classes are located in index.php and news.php file.

uhm. I found the code. But what should I change exatly? :oops:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 04, 2005, 01:45:31 PM
From index.php file :

Quote

$news .= "<tr class=\"imagerow1\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n";
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
    $news .= "<b>".$image_row['news_title']."</b>  -- Posté par <b>".$image_row['user_name']."</b> le <i>".format_date($config['date_format']." ".$config['time_format'], $image_row['news_date'])."</i>";
    $news .= "\n</td>\n";
    $news .= "</tr>\n";

    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
    $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));
    $news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";


Simply change the bolded statement.

Note: There's no classes in news.php file. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 04, 2005, 02:25:44 PM
ohh yea my bad he ;D Thanks.

One last question, how come I can't change the bold font for the user who posted the news. The headline did have <b></b> but not the  $image_row['user_name'] :oops:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 04, 2005, 02:30:11 PM
I knew I should of left the rest of my message on my recent post.

The answer on this is that I took this peace ' from the very original post ' comparing on the top. As you can see, the quoted part I sent does actually includes the bolded tags on the $image_row['user_name']. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 02:48:40 PM
It works fine for me exept the MOD settings cannot be saved thus I cannot use HTML or BB-code in news. Though other options exept the Mod's work well
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 02:52:14 PM
Quote

exept the MOD settings cannot be saved


What is the exact error message you're having on this ?

Quote

thus I cannot use HTML or BB-code in news.


Is this when you're creating / editing the news from ACP ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 03:03:37 PM
Quote

What is the exact error message you're having on this ?


I get no errors, ACP says "Setting saved" but they are not (It happens with News section only)

Quote

Is this when you're creating / editing the news from ACP ?


ACP - General - Settings - News
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 03:07:45 PM
Quote

I get no errors, ACP says "Setting saved" but they are not (It happens with News section only)


This has to be related to an implementation error as this one works perfectly from my end.

Quote

ACP - General - Settings - News


Ok, so what exacly happends when you try to select one or either of them ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 03:15:20 PM
I change News settings: for example: News number 5; days number 5; show the last X news and press Save changes. The page reloads and says "Setting saved" but they are not (setting are back to default (news/days number fields empty and so on))

Maybe I can change these settings by editing a file manually?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 03:22:30 PM
Did you followed the instructions properly regarding the 'X' value you had to remember through each steps of the way ? The proper number value must be added to your settings. Otherwise, it will fail to register into your database.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 03:31:24 PM
Did you followed the instructions properly regarding the 'X' value you had to remember through each steps of the way?
Can you please explain?

I must say that the news appear in the frontpage of my gallery properly ( http://gallery.bittabola.com )
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 03:37:00 PM
Quote

show_table_separator($setting_group[8], 2, "#setting_group_8");
show_setting_row("news_home_display", "show_news_display_options");
show_setting_row("news_nb");
show_setting_row("news_nb_days");
show_setting_row("news_cutoff");
show_setting_row("news_html", "radio");
show_setting_row("news_bbcode", "radio");
show_setting_row("news_bbcodeimg", "radio");


Make sure the number "8" as the setting group ' is ' the right number with your case in order to save your readings your readings accordingly into your database.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 03:43:19 PM
Yes, it is correct (the previous entry is 7)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 03:52:33 PM
And all the rest also follows with 7, for your case, from the instructions ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 03:58:21 PM
It is just as the instruction says. My admin/settings.php:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 04:04:23 PM
In that case, did you checked the permission level on your settings.php file ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 04:17:42 PM
It is 644
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 04:32:18 PM
Quote

It is 644


Increase it : 777 (at least: 755 if 777 is not possible).
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 04:40:43 PM
It didin't help :( In fact, all other options (except the News section) works well, which means I can change any other options and they can be saved (in ACP General Settings)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 04:41:50 PM
In that case, I have no more solutions left except to consider that this might simply be an implementation issue. In the mean time, which version of 4images do you have ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 04:55:40 PM
In the mean time, which version of 4images do you have ?
Latest - 1.7.1
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 05:05:13 PM
That's what I thought. I'm still using v1.7. Perhaps some corrections needs to be done from that general news function, from admin/settings.php file, in order to process the information properly.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 05:17:58 PM
Perhaps some corrections needs to be done from that general news function, from admin/settings.php file, in order to process the information properly.
Are you going to revise?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 05:20:30 PM
I'm sorry. I do not have this type of capabilities yet. Also, like I said, I do not run 4images v1.71 but 1.7.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 05:49:37 PM
I'm sorry. I do not have this type of capabilities yet. Also, like I said, I do not run 4images v1.71 but 1.7.
OK, then we are going to wait for the author
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 05:52:15 PM
The part you're looking for to modify is this :

Quote

function show_news_display_options($setting_name, $setting_value) {
  global $news_display_optionlist;
  foreach ($news_display_optionlist as $key => $val) {
    echo "<input type=\"radio\" name=\"setting_item[".$setting_name."]\" value=\"$key\"";
    if ($setting_value == $key) {
      echo "checked=\"checked\"";
    }
    echo ">".$val."<br />";
  }
}


from admin/settings.php file.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 06:02:03 PM
I am no PHP coder :(

But is it possible that I move the news section to the topmost part of the frontpage (before categories)?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 06:05:03 PM
Quote

But is it possible that I move the news section to the topmost part of the frontpage (before categories)?


If you mean in the album itself, and not in the ACP, of course you can. ;)

You could even simply move the news tag from your templates/<your_template>/home.html file on top of the categories tag.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 06:15:51 PM
WOW! It worked. Thanks  :) One more question :roll: Is there any mod that adds a similar block to the left sidebar? Like "Links" block
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 06:24:49 PM
Links ... you mean like : "Headlines" ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 06:25:48 PM
Yes, but small and in the left sidebar
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 06:27:31 PM
In that case, Please read the last steps in the first post of this topic.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 07, 2005, 06:35:28 PM
Which exatly? (sorry for lame questions  :roll: )
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 07, 2005, 10:23:04 PM
Quote

TheOracle also have done a addon --> http://www.4homepages.de/forum/index.php?topic=9059


big enough ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Xaero on August 08, 2005, 05:42:17 AM
You misunderstood me

Thanks anyway
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle 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.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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 :/
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle 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. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 05:14:58 PM
Whitch files must be with 777 or something....
 permissions?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 05:23:26 PM
Most particularly your news.php file, yes.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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>",

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle 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>",

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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 :/
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 06:01:43 PM
Did you configured your ACP - > Settings - > news settings ? Also, did you posted a news yet ? ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 06:48:08 PM
Quote

i didn't see anything


Didn't. So, now it's fixed ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle 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 ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 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 :/
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 09:03:38 PM
URL ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 09:55:48 PM
That's odd.

What if you replace the whole news.php file with my personalized one then :

Code: [Select]

<?php

$main_template 
'news';
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 .= ($user_info['user_level'] != ADMIN) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."admin/news.php?action=addnews")."\" target=\"admin_add\">".$lang['add']."</a>&nbsp;";
$admin_links .= ($user_info['user_level'] != ADMIN) ? "" "<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 .= ($user_info['user_level'] != ADMIN) ? "" "<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><span class=\"head1\">".$news_row[$i]['news_title']." - ".sprintf($lang['news_posted_by'], $news_row[$i]['user_name'], format_date($config['date_format']." ".$config['time_format'], $news_row[$i]['news_date'])) . "</span></b>",
"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,
  
"news_archives_title" => $lang['news_archives_title'],
  
"clickstream" => $clickstream
));
unset(
$contents);
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');

?>



? ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 10:13:00 PM
see at now :/
don't work...
just template other, because $main_template = 'news';
where is mistake? maybe not there...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 10:19:05 PM
What about your HTML news templates ? Are you sure you did followed the instructions by the letter ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 10:27:26 PM
from the zip file i placed all templates to TEMPLATES DIR
only home.html i change to my, where i put code:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td class="head1" valign="top" height="20">{news_main}</td>
          <td class="head3" align="right" height="20">{news_archives}&nbsp;</td>
       
      </table>
  </tr>
</table><br/>
<div align="center">
  <table width="99%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="commentrow2" align="left">
        <div align="left">{news}</div>
      </td>
    </tr>
  </table>
</div>
at the place where i want to see news mod

news_show.html
news_headlines.html
news_bit.html
news.html
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 10:32:22 PM
Looks good so far. Althought, I wouldn't recommend to put the {news} tag under DIV. ;)

As for the rest of the news HTML file, show me.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 10:37:38 PM
news.html:

Quote
{header}
<table width="640" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td colspan="4"><img src="{template_image_url}/header_top.gif" width="640" height="6" alt="" /></td>
        </tr>
        <tr>
          <td width="6"><img src="{template_image_url}/header_left.gif" width="6" height="60" alt="" /></td>
          <td width="405"><img src="{template_image_url}/header_logo.gif" width="405" height="60" alt="" /></td>
          <td width="225" align="right">
            <table border="0" cellspacing="0" cellpadding="1">
              <form method="post" action="{url_search}">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </form>
            </table>
          </td>
          <td align="right" width="6"><img src="{template_image_url}/header_right.gif" width="6" height="60" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
  <!-- END of HEADER-->
  <tr>
    <td class="bordercolor">
      <table width="640" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="638" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="636" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_image_url}/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right">
                  <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
                  <a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
                 </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="638" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" class="row2" valign="top">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_image_url}/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_image_url}/spacer.gif" alt="" width="4" height="4" />{lang_menu}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{menu} </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {surfers}
              {if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_image_url}/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_image_url}/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_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
              {endif random_image}
                </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_image_url}/spacer.gif" alt="" width="1" height="1" /></td>
                <td width="18" valign="top"><img src="{template_image_url}/spacer.gif" alt="" width="18" height="18" /></td>
                <td width="450" valign="top">
<!-- BEGIN CONTENT -->
{contents}
<br />
                  <!-- END OF CONTENT -->
                </td>
                <td width="19" valign="top"><img src="{template_image_url}/spacer.gif" alt="" width="19" height="19" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6"><img src="{template_image_url}/footer_left.gif" width="6" height="19" alt="" /></td>
          <td width="405">&nbsp;</td>
          <td width="225">&nbsp;</td>
          <td width="6"><img src="{template_image_url}/footer_right.gif" width="6" height="19" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 10:45:19 PM
The problem is here :

Quote

<!-- BEGIN CONTENT -->
{contents}
<br />
                  <!-- END OF CONTENT -->


replace that with :

Code: [Select]

<!-- BEGIN CONTENT -->

{if msg}<br /><b>{msg}</b><br />{endif msg}
{contents}
<br />

<!-- END OF CONTENT -->

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 10:53:14 PM
need tags {msg} ?
ok, i put this, but not work...

my 4images version 1.7.1 - maybe there is problem?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 10:56:14 PM
That is the only possible conclusion I got so far since I use 4images v1.7 . . .
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 10:58:17 PM
In ACP i see this:
Found: 5. Displayed: 1-.
there is mistake?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 11:01:31 PM
No mistakes has been reported regarding the tracking news from ACP. I doubt that it would be considered one.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 11:13:56 PM
any ideas?
how i can fix this problem with archive?
plz, help with this...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 11:17:55 PM
Well, since I already posted news.php file and that the results are the same, I can only determine that this file would need to be modified in order to match with global.php. The other possibility is that the paging system might be slightly different with v1.7.1 comparing to v1.7.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 11:28:34 PM
if i take global.php from version 1.7 and put to 1.7.1 it's ok?
or need to change something, what you say?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 11, 2005, 11:32:49 PM
Quote

or need to change something


You'd definitely need to change something in news.php file in order to match with global.php. It cannot just simply be replaced.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 11, 2005, 11:56:45 PM
Maybe you can write, what i must change?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 12:04:35 AM
Quote

Maybe you can write, what i must change?


Change where exacly ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 12:23:18 AM
I don't understand you
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 12:25:09 AM
I mean : Which one do you wish to change exacly ? News.php file ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 12:35:54 AM
yes, at now is good idea change this :)
news.php

maybe you can write here full news.php to 4images 1.7.1 ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 12:53:24 AM
How can I change elements into something I do not use yet ?  ! ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 12:58:51 AM
need to see :)
if you want, i can post there global.php or something :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 01:04:43 AM
Unfortunitely, I have no knowledge over global.php file.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 01:08:14 AM
ok, thank's for help :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 01:48:03 AM
I just remembered something.

In your global.php file,

find :

Quote

//error_reporting(E_ERROR | E_WARNING | E_PARSE);


or :

Quote

//error_reporting(E_ALL);


On either case, replace with :

Code: [Select]

error_reporting(E_ALL);


Then, reload your news.php file from the web and tell me if you see any error messages from the top header of that page.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 02:14:51 AM
it's good idea :)

Code: [Select]
Notice: Undefined index: auth_viewcat in /var/www/mysite/images/includes/auth.php on line 72
Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67
Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67
Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67
Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67
Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67
whats there in auth.php ? hmmm
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 02:21:22 AM
Right on the spot.

In your news.php file,

find :

Quote

$comment_user_name = htmlspecialchars($news_row[$i]['comment_user_name']);


replace with :

Code: [Select]

//$comment_user_name = htmlspecialchars($news_row[$i]['comment_user_name']);


It doesn't seem to be used anywhere else in that file.

Then, save the file and reload the page again to see if it works. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 02:30:35 AM
 At now:
Notice: Undefined index: auth_viewcat in /var/www/mypage/images/includes/auth.php on line 72

there is:
   if ($val['auth_viewcat'] != AUTH_ALL) {


and not working news...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 02:37:50 AM
Does it say the same on all the pages ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 02:39:43 AM
yes :cry:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 02:42:32 AM
In that case, if other pages works well except the news archives page. I wouldn't worry about that error message. ;)

Since the situation has unchanged for that page, it is most likely an incompatibilty somewhere between that MOD and 4images v1.71.

In the mean time, you may uncomment the error_reporting line in global.php file now.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 02:59:02 AM
what i must do, that news.php works good with version 1.7.1
...
your mod very nice, but not working with new 4images version :(
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 03:00:31 AM
Quote

your mod very good, but not work with new 4images version


To clarify, I'm not the author of this MOD. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 03:06:27 AM
As for :

Quote

Notice: Undefined index: auth_viewcat in /var/www/mysite/images/includes/auth.php on line 72


See that you have the auth_viewcat field in your 4images_categories table. If not, please advise.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 03:24:44 AM
I don't know why, but i can't connect to phpmyadmin web at this moment :/
i can't see what there is..
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 03:25:57 AM
Hum. There isn't much we can do then. Ahh ! well, keep me posted once it's back online. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 03:31:19 AM
ok, but what with news mod? :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 03:37:13 AM
Well, you have a bigger issue to resolve on your hand first - which is the auth_viewcat field.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 03:43:29 AM
There is:

Field  Type Attributes Null Default
auth_viewcat  tinyint(2)   No  0 

I think it's ok
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 02:56:24 PM
TheOracle: when, you think the news.php you will make?
for 4images 1.7.1
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 04:42:02 PM
Quote

There is:

Field  Type Attributes Null Default
auth_viewcat  tinyint(2)   No  0

I think it's ok


Analyze your categories table from your phpmyadmin, I have the impression that this problem might be related to structuring error from that table.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 05:04:19 PM
there is structure ok
i see all ok in that table
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 05:07:34 PM
Does Phpmyadmin lets you access to extended analysis ? I know that with Navicat Software, this feature is available.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 05:37:01 PM
i don't understand what you mean maybe..

auth_viewcat  table not deleted or something..
there is ok
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 05:39:24 PM
Quote

there is ok


Then, in that case, I do not have any solutions left otherwise to think that this might simply be an installation issue of 4images.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 05:52:16 PM
TheOracle:
maybe you can help me with news mod plz?
maybe you can made news.php for me?
Archives not working with 4images 1.7.1 :(
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 06:22:52 PM
Quote

Archives not working with 4images 1.7.1


Sorry. No support will be given on this one as I already explained that I do not use 4images v1.7.1.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 06:51:50 PM
But, if you download this version and install, then you have it :)

if you know good php, you just see whats new there..
Where is Vincent? :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 06:57:32 PM
Unfortunitely, I do not have all this time from my end as I'm currently building new MODs that's been requested from other users.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 07:34:00 PM
Quote
I'm currently building new MODs
Maybe you can built new mod for news, but with archive?
and for 1.7.1 version :)

Maybe you know where i can download 4images 1.7.0 ?
with this(1.7.1) version many problems!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 07:38:17 PM
Quote

Maybe you know where i can download 4images 1.7.0 ?


Isn't that available from the downloads link of this site ?  :?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on August 12, 2005, 07:41:05 PM
Quote
Isn't that available from the downloads link of this site ?  :?
NO, just 1.7.1
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 12, 2005, 07:50:43 PM
How unfortunite. The two version days are gone I guess. 8)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: whirleyes on August 19, 2005, 08:14:16 PM
i've read somewhere in this forum.... i guess it's similar to the guestbook mod prob...
you have to edit your template (news.html)

find

Code: [Select]
<!-- BEGIN CONTENT -->
{if msg}<br /><b>{msg}</b><br />{endif msg}
{contents}
<br />
                  <!-- END OF CONTENT -->

replace with
Code: [Select]
<!-- BEGIN CONTENT -->

{if msg}<br /><b>{msg}</b><br />{endif msg}<br />
{news_contents}<br />
{contents}
<br />

<!-- END OF CONTENT -->

am i right???
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on August 19, 2005, 08:20:26 PM
I don't remember seeing that post in the past ... does it actually work ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on September 05, 2005, 12:57:41 PM
// [Bugs-Correction] - admin/news.php

I encountered some slight bugs in the admin/news.php file. For those who encountered some errors when using the search page for the news, this is what you have to do to fix.

In that file,

find :

Quote

$sql = "SELECT COUNT(*) AS news
           FROM ".NEWS_TABLE."           
           WHERE $condition";
$countusers = $site_db->query_firstrow($sql);


replace with :

Code: [Select]

$sql = "SELECT COUNT(*) AS news
           FROM ".NEWS_TABLE." n
           LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = n.user_id)
           WHERE $condition";
$countusers = $site_db->query_firstrow($sql);


Then, find :

Quote

if ($limitfinish > $countusers['users'] == 0) {
    echo "<b>".$limitfinish."</b>.";


add above :

Code: [Select]

$countusers['users'] = array();


Then, find :

Quote

if ($limitnumber == "") {


add above :

Code: [Select]

$limitnumber = "";


That should be all. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ID25 on September 05, 2005, 11:12:16 PM
At now this mod work with 4images 1.7.1
thank's  :wink:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on September 05, 2005, 11:41:20 PM
Quote

At now this mod work with 4images 1.7.1


Are you saying that, after implementing this patch, this works with 4images v1.7.1 now ?  8O
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on September 21, 2005, 08:54:54 PM
Is there a way to put the date under the headline. It seems the only way is to edit index.php. But can't figure out what?

*EDIT*

Got it working. Just added <br /> to the main.php language file (where the date is) and that worked :)
 - lars
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ch€ri{Bi}² on October 03, 2005, 02:05:41 PM
Quote
this works with 4images v1.7.1 now ?
Yes it works with v1.7.1.

now,
 :?: Is there a way to perform a search in the news?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ch€ri{Bi}² on October 03, 2005, 11:18:59 PM
second question: 
 :?: how can I limit the size of the displayed news?

 for example, it could show only 200 characters and the user will be able to reach entire message while clicking on a link called "more details"
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Rookie79 on October 05, 2005, 05:01:49 PM
 :?:How can my registered users publish news? :?:

4images 1.7.1 and it works :D
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Lesik on October 06, 2005, 07:48:06 AM
I can't use BBCODE, after install this MOD, i don't see BBCODE in mode new news and edit news. Help me.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: cabdragon on October 09, 2005, 10:18:19 PM
Hey I got a problem in the ACP.
Everything s fine despite one thing:

In the ACP where the links are listed (like: Categories, Images, Comments...) Under the block of comments there should appaere the block fpr "news" but there's not enough space to show it, i just am able to see the very top of the lines, but no letters, so I am able to click in the categories (in order to start a news or to edit a news, but it doesn't really show the buttons.

You know what I am meaning. I just don't know where to change the height for that rows.
Which file does that fit?

Ok found out something: everything's alright, but there are no characters within the rows, the table is just empty at that point, how can i fix this?

THX for your help
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: fgallery on October 14, 2005, 06:18:23 PM
I have the same problem as Xaero.
Version 1.7.1

Can you explain this step:
#-----[ DATABASE UPDATE ]------------------------------------------
What do I have to do exactly to DB ?
Maybe this is the reason why my settings aren't saving.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ch€ri{Bi}² on October 14, 2005, 08:13:18 PM
#-----[ DATABASE UPDATE ]------------------------------------------
What do I have to do exactly to DB ?
Maybe this is the reason why my settings aren't saving.

 :idea: why not try this topic (http://www.4homepages.de/forum/index.php?topic=6824.msg46587#msg46587) ? it seems to be the same MOD  :wink:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: fgallery on October 16, 2005, 01:04:20 PM
#-----[ DATABASE UPDATE ]------------------------------------------
What do I have to do exactly to DB ?
Maybe this is the reason why my settings aren't saving.

 :idea: why not try this topic (http://www.4homepages.de/forum/index.php?topic=6824.msg46587#msg46587) ? it seems to be the same MOD  :wink:

Thanks man!
This mod is so problematic!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Joshi on October 28, 2005, 02:01:24 PM
Installed and working great, thanks, but how do I change the language on the date?
I need to aply the setlocale() thingy somewhere i guess, but where.
To go from Saturday --> Samedi (example)

Sure, it uses the general time setting, but V@no locked that thread, so i suppose it was a mod regarding question.
Otherwise thanks for a great mod!

J
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Dalton on November 11, 2005, 05:26:53 PM
how can i change width of my news table ?? i use different style than default and it lookes wierd :/
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Zyga on December 02, 2005, 11:25:30 PM
I saw many people with similiar problem to mine - empty news archives
 in v 1.7.1

maybe someone resolved problem ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: janfy on December 06, 2005, 10:27:45 AM
Yes i have !
I'll post the new version of this MOD ASAP !
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: castor on December 16, 2005, 11:30:06 AM
hi to all !
one simple question ,  where can i delete this spaces in the code ?
im searched for it, but cant find.. 
(http://www.castorsworld.de/bilder/space_remove.jpg)
thx for support ..
bye Lars
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: janfy on December 16, 2005, 11:46:25 AM
Hi,

Find following code in index.php file at the 4images root directory :

Code: [Select]
$news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
$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));
$news .= "<br/><br/>\n</td>\n";

And remove <br/> tags.

Thats all folks.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: castor on December 16, 2005, 11:57:46 AM
@janfy

thanks a lot... it works,, ..    :mrgreen:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Zyga on December 17, 2005, 05:40:42 PM
I fight with it but..... :oops:

when i dont have news i see "no news" how can I add something like {if_news} news table here {end_if_news)  :?:


I need to remowe whole table when no news
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: janfy on December 19, 2005, 01:54:45 PM
I fight with it but..... :oops:

when i dont have news i see "no news" how can I add something like {if_news} news table here {end_if_news)  :?:

I need to remowe whole table when no news

Hi, here is a solution

Find the following code in index.php file at the 4images root directory
Code: [Select]
if (!$num_rows)  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $news .= $lang['no_news'];
  $news .= "</td></tr></table>";
}

and replace by the following code :

Code: [Select]
if (!$num_rows)  {
  $news = "";
}

Find the following code in home.html file in directory <4images root directory>/templates/default (il you use the default template)

Code: [Select]
<table width="450" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="head1">
      <table width="100%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td class="head1">{news_main}</td>
          <td class="head1" align="right"><a class="head1" href="news.php">{news_archives}</a></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head1" colspan="2">{news}</td>
  </tr>
</table>

Add before this code :

Code: [Select]
{if news}
Add after this code :

Code: [Select]
{endif news}
That's all folks
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Digital1 on December 23, 2005, 12:39:59 AM
I installed the mod, and it works fine. But when I post something under news... Who it is posted by is not in english. How Do I fix that?

Example... "Poste Par "so in so".

Rather, I want... Posted by "so in so".


ps- "newbie" under my name says it all. :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: janfy on December 23, 2005, 10:55:16 AM
Edit file index.php,

FIND this line :

Code: [Select]
$news .= "<b>".$image_row['news_title']."</b>  -- Posté par <b>".$image_row['user_name']."</b> le <i>".format_date($config['date_format']." ".$config['time_format'], $image_row['news_date'])."</i>";
and REPLACE by this one :

Code: [Select]
$news .= "<b>".$image_row['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']));
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Zyga on December 24, 2005, 08:35:19 PM
yeah thx !

it works great
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: aq8.net on December 25, 2005, 02:02:23 PM
hi

i got something for you

you can change the news text feild to make it small with (read more..).... and a link for sure

how to make that ? simple

in index.php (make back up ist)

try to find
Code: [Select]
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";

replace with

Code: [Select]
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_id, news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";

and also in index.php

try to change this code

Code: [Select]
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
$news .= "<b><a href=newsfull.php?news_id=".$image_row['news_id'].">".$image_row['news_title']."</a>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";
    $news .= "</tr>\n";
    $boldstart = "<b>";
    $boldend = "</b>";
    $news_text = substr($image_row['news_text'],0, 400);
    $image_row['news_text'] = $news_text;
    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
$news .= $boldstart.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));
$news .= "<b>.....</b>";
$news .= "<b><a href=newsfull.php?news_id=".$image_row['news_id'].">".$lang['news_tafasel']."</a></b>";
$news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";

to be like this

Code: [Select]
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
$news .= "<b>".$image_row['news_title']."</b>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."</sup>":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";
    $news .= "</tr>\n";

    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
$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));
$news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";

also in index.php

change this code

Code: [Select]
$site_template->register_vars(array(
"news" => $news,
"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php"\" class=\"link\">".$lang['news_archive']."</a>",
"news_main" => $lang['news_main']
));

to become this code

Code: [Select]
$site_template->register_vars(array(
"news" => $news,
"news_archives" => "<a href=\"\".$site_sess->url(ROOT_PATH.\"news.php\"\" class=\"link\">".$lang['news_archive']."</a>",
"news_main" => $lang['news_main']
));

this is for index.php

the newsfull.php = news.php ....( i rename the file)

demo www.aq8.net/library
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on December 25, 2005, 02:42:44 PM
@aq8.net :

I have not tested your codings but sounds interesting.

Althought, I have found weaknesses in your modifications.

Find :

Quote

$news .= "<b><a href=newsfull.php?news_id=".$image_row['news_id'].">".$image_row['news_title']."</a>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";


replace with :

Code: [Select]

$news .= "<b><a href=\"".$site_sess->url(ROOT_PATH."newsfull.php?news_id=".$image_row['news_id'])."\" class=\"link\">".$image_row['news_title']."</a>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";


Then, find :

Quote

$news .= "<b><a href=newsfull.php?news_id=".$image_row['news_id'].">".$lang['news_tafasel']."</a></b>";


replace with :

Code: [Select]

$news .= "<b><a href=\"".$site_sess->url(ROOT_PATH."newsfull.php?news_id=".$image_row['news_id'])."\" class=\"link\">".$lang['news_tafasel']."</a></b>";


Then, find :

Quote

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


replace it with :

Code: [Select]

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


These should do the trick. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: mawenzi on December 25, 2005, 02:44:11 PM
For presentation of this news in a NEWS-READER :
Für die Präsentation dieser News in einem NEWS-READER :

[MOD] News-RSS-Feed V.1.0 (http://www.4homepages.de/forum/index.php?topic=10715.0)

mawenzi
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: aq8.net on December 25, 2005, 02:44:58 PM
you are the king

:)

any way i was try to help and the code is working with me fine
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on December 25, 2005, 03:03:28 PM
Quote

any way i was try to help and the code is working with me fine


I may believe so. Althought, you did not used $site_sess within your <a href which is a pretty high risk when requesting your users to be logged in. ;)

In the mean time, one line were badly commented when using the $site_sess class statement.

However, all has been fixed now and thanks for posting this.

Merry Christmas.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: aq8.net on December 26, 2005, 02:06:07 PM
i did so and it work with the sessionid ....

thanks
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on December 26, 2005, 02:53:42 PM
Quote

i did so and it work with the sessionid ....


May be it did. However, it wasn't validated through the SQL's sessions table. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on December 30, 2005, 01:17:06 AM
@aq8.net :

Recently, I have created a tutorial on this subject. Perhaps you'd like to take a look at it to gain more information about this :

http://www.4homepages.de/forum/index.php?topic=10897.0

;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: castor on December 30, 2005, 12:02:38 PM
@ aq8.net :
 the Copyright footer at your site is not readable.. in this color ..
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: JensF on January 16, 2006, 10:59:41 AM
Hi ivan,

danke für deine Mail aber dein Problem hättest du eventuell selber lösen können wenn du das Thema hier genau verfolgt hättest ;)

http://www.4homepages.de/forum/index.php?topic=9064.msg45868#msg45868

Ich hoffe das hilft dir weiter....
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on January 16, 2006, 05:25:42 PM
Would it be possible to report this problem in english in order to have a better understanding of this situation ? ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on January 16, 2006, 05:58:45 PM
Quote

this should hums of to be realigned to have


This has already been reported in the past. Althought, I do not think there's a fix for this yet. There must be a mis-calculated statement from admin/news.php file. ;)

* EDIT *

The error is here :

Quote

$limitnumber = "";
  if ($limitnumber == "") {
    $limitnumber = 5000;
  }


Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on January 16, 2006, 06:19:53 PM
I did see it. Since you reported this error, I also stated the paragraph that "is" from your file above in the mean time.  :?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on January 19, 2006, 06:57:49 PM
Quote

Here does nobody have a solution that news.php in acp is differently indicated?


As stated above, the error is about a mis-counted value from the bolded paragraph I mentionned from the quote. :roll:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on February 01, 2006, 04:00:19 PM
Quote

It reported user that it with them functioned


I really can't understand what you're trying to say here . . .  :oops:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: TheOracle on February 01, 2006, 04:23:36 PM
Sorry, I did not find a solution for this yet.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Fastian on March 23, 2006, 10:13:22 PM
This mod allows to use bbcode & html. I mean in setting you have these options.
I added smilies to bbcode and it works as well.

But the only issue is.
While posting a news from ACP, I can’t see any direct option to use bbcode or smilies. I think the statement where it calls bbcode is not there.

Or m I missing Something ??
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Zyga on March 25, 2006, 02:16:09 PM
little idea  :idea:

is it posiible to (add) allow (/or not) users comments to  news ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ch€ri{Bi}² on March 27, 2006, 11:57:03 AM
While posting a news from ACP, I can’t see any direct option to use bbcode or smilies. I think the statement where it calls bbcode is not there.

Or m I missing Something ??

for the moment i think there are no code on this forum to use bbcode (with buttons!) directly in ACP... :roll:
perhaps some of the gurus or coders can cure it... but it won't be easy : there is at least 3 codes to implement bbcode on this forum... :?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: idijotaz on April 13, 2006, 07:00:29 PM
help... im getting error
Code: [Select]
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/index.php on line 126

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/index.php on line 126
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: gifwav on May 08, 2006, 05:49:14 PM
Hello,

This mod allows to use html. It works on my main news page, but the archive page doesn't.
I get something like this: <img src="images/v85_001_400.jpg" align="left" vspace=10 hspace=10>
See: http://www.urbanusvolleybal.nl/news.php

How can I solve this?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: tansamalaja on May 29, 2006, 06:46:16 PM
help... im getting error
Code: [Select]
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/index.php on line 126

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/index.php on line 126


I'm getting the same error report, has anybody an idea what's wrong?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: tansamalaja on May 29, 2006, 07:04:01 PM
I've got it!

#
#-----[ OPEN ]---------------------------------
#
index.php

#
#-----[ FIND ]---------------------------------
#
[qcode]unset($categories);[/qcode]

#
#-----[ AFTER, ADD ]------------------------------------------
#
[qcode]//-----------------------------------------------------
// ----- Show news ------------------------------------
//-----------------------------------------------------

if (!isset($config['news_home_display']) || $config['news_home_display'] == 1)
   $sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT 0, ".((isset($config['news_nb']))?$config['news_nb']:5);
else if ($config['news_home_display'] == 2)
   $sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";

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

if (!$num_rows)  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $news .= $lang['no_news'];
  $news .= "</td></tr></table>";
}
else  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";

  while ($image_row = $site_db->fetch_array($result))
  {
    $news .= "<tr class=\"imagerow1\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n";
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
      $news .= "<b>".$image_row['news_title']."</b>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."</sup>":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";
    $news .= "</tr>\n";

    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
      $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));
      $news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";

  } // end while

  $news .= "</table>\n";
} // end else

$site_template->register_vars(array(
   "news" => $news,
   "news_archives" => $lang['news_archive'],
   "news_main" => $lang['news_main']
));
unset($news);[/qcode]

Now it's working fine by me...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Stoleti on May 29, 2006, 08:11:01 PM
What is the difference between this MOD and the another NEWS MOD , here published too ?

 :?:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: cookie on June 12, 2006, 08:32:03 AM
I had an error similar to this
Quote
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

on line 130 - I found the following line of code
Code: [Select]
"news_archives" => "<a href=\"".$site_sess->url(ROOT_PATH."news.php"\" class=\"link\">".$lang['news_archive']."</a>",
when I searched further in the forum, I found a post from TheOracle replying to ID25, who had the same error message that I did. The reply is quoted below.

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>",


Perhaps this should be changed in the original posting.  I too had the same problem as ID25, until I skimmed through and found the solution further down in the post.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: cookie on June 12, 2006, 10:12:50 AM
I found another problem issue that should be added to the original post for this MOD.

I was unable to save the news settings in ACP > Settings > News

After reading through all the posts, and seeing that ID25 had the same problem that I did, I realized that there was a link to a very bizarre post from TheOracle regarding an Add-on to this module. 

It is here > http://www.4homepages.de/forum/index.php?topic=9059

However, the top post only has the text "--" and several replies from various people.  Within that thread, I found a post from TheOracle which mentions that the SQL updates/instructions is incomplete for this Module.

You must run install_news.php - which IS part of the original post(instructions) for this MOD.

However, you must also execute the following SQL through PHPMyAdmin, which adds 7 rows to the 4images_settings table

Code: [Select]
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_home_display', '1');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_nb', '10');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_nb_days', '15');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_cutoff', '3');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_html', '0');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_bbcode', '1');
INSERT IGNORE INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('news_bbcodeimg', '1');

After adding these to my 4images_settings table, I am able to change and save the news settings through ACP > Settings

This MOD would be easier to install if all the instructions were at the top of the post.

Regards.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ahbut on June 26, 2006, 08:19:06 AM
I had install everything following the installation steps carefully, I got control in the ACP correctly and able to save the setting, it shows on home.html correctly, but once I hit 'archives', which is news.php, it gives me a blank page only, other then the other header and footer are correctly displayed, I don't see anything in there for all news that I have posted..
 
But on the home.html page, it will show the news I added
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: artique on July 11, 2006, 03:25:53 PM
Anyone got the original files for this mod,  ta
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on July 28, 2006, 05:16:21 AM
Hi there. I would love to install this on my page and just want to ask, before I do, if it functions well in version 1.7.3


Laurie
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Fryz on August 03, 2006, 11:08:49 AM
die "alten news" werden nicht im archiv angezeigt. wo hab ich denn da nen fehler gemacht?

danke
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: tdkpaul on August 05, 2006, 09:15:25 PM
was ist denn nun der beste News Mod für 1.7.2?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: *Marco* on August 06, 2006, 06:11:02 PM
Hi there. I would love to install this on my page and just want to ask, before I do, if it functions well in version 1.7.3

I have the same question, but no answers :?: :?:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: tdkpaul on August 06, 2006, 06:50:19 PM
i think this question can only be answered by yourself

you have to try it

i also have tried a lot of mods for 1.7 and 1.71 and most of them works for me
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: reehsetin on August 09, 2006, 12:49:39 AM
has anyone else had a problem with people registering after they have installed the mod, this is the only thing to have changed now whenever someone tries to register it asks for a verification code where there isnt actually a verification box there
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 11, 2006, 09:02:34 PM
Thank you for the easy directions for changing and adding information to the various files, I have managed to get everything successfully changed but... I am getting these errors at the top of my gallery homepage:

DB Error: Bad SQL Query: SELECT news_title, news_text, user_name, news_date FROM 4images_news ORDER BY news_date DESC LIMIT 0, 5
Table 'darrenha_blog1.4images_news' doesn't exist

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/darrenha/public_html/galleries/includes/db_mysql.php on line 116

My gallery is located at http://www.darrenhayesinteractive.com/galleries/ , can anyone tell me how to get rid of my errors then?


Laurie
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 12, 2006, 04:03:31 AM
Is anyone able to help me out with my above problem? At this point, I am very willing to pay someone for their time.


Laurie
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 11:37:25 AM
Is anyone able to help me out with my above problem? At this point, I am very willing to pay someone for their time.


Laurie

Is the news working for you. Cause to me it looks like the table where the news are being saved does not exist
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 13, 2006, 06:56:37 PM
Is anyone able to help me out with my above problem? At this point, I am very willing to pay someone for their time.


Laurie

Is the news working for you. Cause to me it looks like the table where the news are being saved does not exist

Hi there :) Thank you so very much for responding.

No, the news isn't working at all. Even though everything is in my control panel, enabling me to enter news, it will not let me save anything.  I'm wondering if I missed the installation of something.. but I ran through the directions two times and each time I get what is appearing on my site  :?

 Laurie
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 07:35:59 PM
and you did run install_news.php from the zip file?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 13, 2006, 07:51:47 PM
Yeah I did but perhaps something went wrong with it. Do you know where the zip file is located? I can't find the thread it is located in. LOL I am having a bad day!  :lol:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 09:46:58 PM
it is here --> http://www.4homepages.de/forum/index.php?action=dlattach;topic=9064.0;id=177
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 13, 2006, 10:12:04 PM
Thank you so much for that :)  I just reinstalled everything and am still getting that same error message lol Have mercy!  I wonder if I am putting the news.sql file in the wrong place. 
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 10:19:02 PM
aha, so you used that one.

go to myphpadmin and click sql (under the table you want to use) there you can upload the news.sql file
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 13, 2006, 10:52:32 PM
aha, so you used that one.

go to myphpadmin and click sql (under the table you want to use) there you can upload the news.sql file

Hmmm well, not neccessarily lol If I don't need to install it, I won't. I have added all the html files, all the php files, I have double checked permissions.. and I am still getting those errors at the top of my page, and an additional one now (that was not there before) in my actual control panel in the settings area, in the news settings, which says: "
Fatal error: Call to undefined function show_news_display_options() in /home/darrenha/public_html/galleries/admin/settings.php on line 161"
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 11:05:17 PM
I'm pretty sure you got phpmyadmin on the server you are on (sure I did some typos before)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 13, 2006, 11:46:20 PM
Bart! Thank youuuuuuuuu! It was an issue with where I placed the news database! It's up now, errors are gone, and I can add news! YAY! I still have an error in my 4 images control panel, under settings, news.. I can't see any news display options, I have this message in there instead: 
 
Fatal error: Call to undefined function show_news_display_options() in /home/darrenha/public_html/galleries/admin/settings.php on line 161[/i]

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 13, 2006, 11:49:43 PM
Bart! Thank youuuuuuuuu! It was an issue with where I placed the news database! It's up now, errors are gone, and I can add news! YAY! I still have an error in my 4 images control panel, under settings, news.. I can't see any news display options, I have this message in there instead: 
 
Fatal error: Call to undefined function show_news_display_options() in /home/darrenha/public_html/galleries/admin/settings.php on line 161[/i]



And you did the steps right?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 14, 2006, 12:03:08 AM
Yeah I am certain I did. Ran through it twice, and prior to redoing everything, interestingly enough, the one thing that did work right was the news settings in the control panel lol 
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: BartAfterDark on August 14, 2006, 12:09:15 AM
and what is on line 161?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 17, 2006, 07:52:42 PM
Does anyone have any suggestions as to how I can fix the error of my date and time on my news section?  Even after checking all files, as well as the global.php file, I am not able to find a way to fix the issue of the date of my news always stating "Posted on 31.12.1969 18:00"
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: terryjianlin on August 22, 2006, 02:43:29 AM
Ater install this mod , I have noticed that something is missing in this mod. on the news.html, there are two tag {lang_menu}and {menu} doesn't appear on the new page, and I have checked the new.php, there is no code about these two tag.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Laurina on August 22, 2006, 06:36:13 AM
Hmmm I hadn't noticed that Terry. I will have to look into that.

Are you having the same troubles as me as far as the date and time news is posted?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: macmaster_it on August 23, 2006, 05:22:23 PM
Hallo at all!!
Great Mod- works fine!!

But I have a question:

Mi site is made in 3 languages (germ./engl./ital.), the news can be written only in the ACP and I would have a choice for the news.

Will mean:
written in english it will showen only when the leng is engl.

it must be a button in the texteditor....

can anybody help me???


(sorry my bad english!)

greatings ron.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: cappuccino on September 19, 2006, 05:04:36 AM
Hello,
where can i insert a blank line between the new write news in the index.php (Startpage)??


When I insert  images in the news, there is a border around the picture. Where can i disable this boarder?

Look here in this Testgallery
http://test.pixxgallery.de/index.php

and the archive
http://test.pixxgallery.de/news.php

THX
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: cappuccino on September 20, 2006, 03:05:29 AM
Hello,
anybody understand my question? :D
i have allready attached a picture about my problem.

I hope anybody can help me.

Thanks
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: paburmester on September 25, 2006, 08:44:06 PM
Quote
I get no errors, ACP says "Setting saved" but they are not (It happens with News section only)

Someone whis the solution for 1.7.3 ? Please help me...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: paburmester on October 02, 2006, 03:43:09 AM
Someone to help me? Please! I just want to know how can I save my settings in ACP. Please! :cry:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: paburmester on October 03, 2006, 01:00:42 AM
I found this:

Quote
1st PROBLEM: Settings for news system are not saved:
   
      SOLUTION:
      As deenee said, there is some data missing in the table "settings" for the news settings to be saved.
      This is the SQL I used to insert the lines:

         INSERT INTO `settings` VALUES ('news_home_display', '1');
         INSERT INTO `settings` VALUES ('news_nb', '2');
         INSERT INTO `settings` VALUES ('news_nb_days', '10');
         INSERT INTO `settings` VALUES ('news_cutoff', '5');
         INSERT INTO `settings` VALUES ('news_html', '0');
         INSERT INTO `settings` VALUES ('news_bbcode', '0');
         INSERT INTO `settings` VALUES ('news_bbcodeimg', '0');

      As you can see, I have assigned an initial value (the number on the right for each setting) which I thought was fine.
      So copy&paste these lines in your MySQL GUI and now from the ACP you'll be able to successfully set the news settings

But I dont know how to do it...  :oops:  can some body please explain to me?
thanks
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Fragezeichen on October 16, 2006, 12:20:27 AM
hallo,
ich habe leider ein anzeigeproblem bei den news in der home.html
zwischen den zeilen ist der abstand zu groß,weis jemand wo ich das ändern kann?

there a problem with the space between the words by the home.html,how to make it smalle?
example on my page
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: kyzer on October 22, 2006, 03:35:38 PM
hi...
eih I got a little problem...
the problem is... when I'm going to add news in administration...
the page doesn't show...
I did everything right... I think!
Can you help me???

www.acoresxtreme.com (http://www.acoresxtreme.com)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Entropyx on November 19, 2006, 05:42:22 AM
i installed this mod, but i get this error on index.php

Quote
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/myke/public_html/index.php on line 126

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/myke/public_html/index.php on line 126
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 21, 2006, 09:36:52 AM
Hi Entropyx,

try this

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>",

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 21, 2006, 10:46:34 AM
I found this:

Quote
1st PROBLEM: Settings for news system are not saved:
   
      SOLUTION:
      As deenee said, there is some data missing in the table "settings" for the news settings to be saved.
      This is the SQL I used to insert the lines:

         INSERT INTO `settings` VALUES ('news_home_display', '1');
         INSERT INTO `settings` VALUES ('news_nb', '2');
         INSERT INTO `settings` VALUES ('news_nb_days', '10');
         INSERT INTO `settings` VALUES ('news_cutoff', '5');
         INSERT INTO `settings` VALUES ('news_html', '0');
         INSERT INTO `settings` VALUES ('news_bbcode', '0');
         INSERT INTO `settings` VALUES ('news_bbcodeimg', '0');

      As you can see, I have assigned an initial value (the number on the right for each setting) which I thought was fine.
      So copy&paste these lines in your MySQL GUI and now from the ACP you'll be able to successfully set the news settings

But I dont know how to do it...  :oops:  can some body please explain to me?
thanks

Hi Paburmester,
- you must enter into your phpmyadmin,
- then click this button (http://www.4homepages.de/forum/index.php?PHPSESSID=6253ef456cd02b467051a0df580edfb2&action=dlattach;topic=9064.0;id=1089;image)
- a new window will open
- paste this code into the window

         INSERT INTO `settings` VALUES ('news_home_display', '1');
         INSERT INTO `settings` VALUES ('news_nb', '2');
         INSERT INTO `settings` VALUES ('news_nb_days', '10');
         INSERT INTO `settings` VALUES ('news_cutoff', '5');
         INSERT INTO `settings` VALUES ('news_html', '0');
         INSERT INTO `settings` VALUES ('news_bbcode', '0');
         INSERT INTO `settings` VALUES ('news_bbcodeimg', '0');

- click Go


Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 21, 2006, 11:20:53 AM
Hi,
can you tell me how to show only Title and Date instead of Title, Posteb by "user", Date, Time.

for example:
New photos! -- 17.11.2006

insteaf of
New photos! -- Posted by webax on 17.11.2006 08:17

Another question,
I have not understood how to fix the blank page in the archive, can you help me?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Entropyx on November 22, 2006, 01:03:11 AM
Hi Entropyx,

try this

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>",

that worked, thank you :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Entropyx on November 22, 2006, 02:41:27 AM
another problem, my settings for the news in Admin CP doesn't save...
after pressing update, it just goes back to the default settings
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 22, 2006, 09:11:11 AM
another problem, my settings for the news in Admin CP doesn't save...
after pressing update, it just goes back to the default settings


read this message http://www.4homepages.de/forum/index.php?PHPSESSID=0aab8f80d69fc1e80cf7d6fd3b7b1115&topic=9064.msg71516#msg71516
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 22, 2006, 09:13:09 AM
hallo zusammen, ich hoffe jemand kann mir auf deutsch antworten.

ich habe folgendes problem:
wenn ich das archiv öffne, wird eine leere seite (news.html) angezeigt.

sonst funktioniert alles einwandfrei, nur die daten im archiv werden nicht
angezeigt.

was ist hier falsch.... hoffe mir kann jemand helfen! vielen dank

hier der link: http://test.hostserver1.de, dann NEWS BOX, dann ARCHIV


ZUSATZ:

Problem gelöst, folgendes hatte gefehlt:

{if msg}<br /><b>{msg}</b><br />{endif msg}<br />
{news_contents}<br />
{contents}
<br />

(fett)

danke an jens für den tip!!!

wow! now ARCHIVES is ok! I have 4images 1.74
thanks Ivan!!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Entropyx on November 22, 2006, 03:56:56 PM
another problem, my settings for the news in Admin CP doesn't save...
after pressing update, it just goes back to the default settings


read this message http://www.4homepages.de/forum/index.php?PHPSESSID=0aab8f80d69fc1e80cf7d6fd3b7b1115&topic=9064.msg71516#msg71516
sweet thanx :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 25, 2006, 12:52:27 PM
Hi,
can you tell me how to show only Title and Date instead of Title, Posteb by "user", Date, Time.

for example:
New photos! -- 17.11.2006

insteaf of
New photos! -- Posted by webax on 17.11.2006 08:17


can anyone help me? pleaseeeee
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on November 27, 2006, 08:49:54 PM
hi alessio,
your modify code is in lang/italian/main.php

$lang['news_posted_by'] = " -- <b>%s</b>";

try this ;)

Hi Ivan, thank you for your reply.
I have already tried it but don't work. I have also tried to edit news.php with a partial success, news in homepage are ok but not the news in archives.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on December 03, 2006, 06:24:06 PM
RSS crashed,  two errors appears if I go to http://www.webax.it/rss.php?action=images

Notice:  Use of undefined constant version - assumed 'version' in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/rss.php on line 42

Notice:  Undefined index:  version in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/rss.php on line 42


These errors occours perhaps after installing MOD Multi-Language support for any text
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MTsv DN on December 10, 2006, 11:22:23 AM
Hi for ALL...

How I must change an Search Engine for searching in News???

Thanks...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MTsv DN on December 10, 2006, 10:08:22 PM
Hi again...

I'm only learning PHP...and English too :oops: and you may think what this code is crazy, but it work:
File: search.php
Find:
Code: [Select]
$content = $site_template->parse_template("search_form");
}

Add after:
Code: [Select]
//-----------------------------------------------------
//--- Search in news -------------------------------------
//-----------------------------------------------------
    $sql = "SELECT COUNT(*) AS num_rows_all
            FROM ".NEWS_TABLE." n";
    $row = $site_db->query_firstrow($sql);
    $num_rows_all = $row['num_rows_all'];

$count = 0;
    for ($i = 1; $i < $num_rows_all+1; $i++) {
        $sql = "SELECT n.news_title
                FROM ".NEWS_TABLE." n
                WHERE n.news_id = $i";
        $row = $site_db->query_firstrow($sql);
$found_str   = '_ ';
        $found_str  .= $row['news_title'];
        $found_str  .= ' ';
$sub_str     = ' ';
        $sub_str    .= $search_keywords;
        $sub_str    .= ' ';

        $found_title = $row['news_title'];
        if (strpos( $found_str, $sub_str ) != 0) {
  $count++;
          print $found_title; // Trying
          print '<br>';         // Trying
}
        $site_db->free_result($row);
    }
//-----------------------------------------------------
//--- Search in news -------------------------------------
//-----------------------------------------------------

Now I have the trouble at Shown Result... Anybody, help me please!!!
Title: [ADDON] Search in News Title and Text ([MOD]Another Simple News Publishing Mod)
Post by: MTsv DN on December 11, 2006, 09:29:21 AM
Now I have the trouble at Shown Result... Anybody, help me please!!!

Hi... Thanks for anybody :? It's a Sarcasm :? And now:

[ADDON] Search in News Title and Text ( [MOD]Another Simple News Publishing Mod )
INSTALL:
OPEN Search.php

FIND:
Code: [Select]
if (!$num_rows_all && $show_result == 1)  {
  $msg = preg_replace("/".$site_template->start."search_keywords".$site_template->end."/", $search_keywords, $lang['search_no_results']);
}

REPLACE WITH:
Code: [Select]
//-----------------------------------------------------
//--- Search in news /MTsv DN/ ------------------
//-----------------------------------------------------
 $founding_title    = '';
 $founding_text     = '';
 $founded_title     = '';
 $founded_text      = '';
 $search_str        = $search_keywords;
 $count_newses      = 0;
 $num_rows_news     = 0;
 $sql = "SELECT COUNT(*) AS num_rows_news
         FROM ".NEWS_TABLE." n";
 $row = $site_db->query_firstrow($sql);
 $num_newses = $row['num_rows_news'];

 for ($i = 1; $i < $num_newses + 1; $i++) {
     $sql = "SELECT n.news_title, n.news_text
             FROM ".NEWS_TABLE." n
             WHERE n.news_id = $i";
  $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);

     $row = $site_db->query_firstrow($sql);
     $founding_title   = '_';
     $founding_title  .= $news_row[0]['news_title'];
     $founding_text    = '_';
     $founding_text   .= $news_row[0]['news_text'];
     $founded_title    = $news_row[0]['news_title'];
     $founded_text     = $news_row[0]['news_text'];
     if ((strpos( $founding_title, $search_str ) != 0) ||
         (strpos( $founding_text,  $search_str ) != 0)){
        $count_news++;
     }
     $site_db->free_result($news_row);
 }
//-----------------------------------------------------
//--- Search in news /MTsv DN/ ------------------
//-----------------------------------------------------

if (!$num_rows_all && $show_result == 1) {
 if (!$count_news && $show_result == 1) {
  $msg = preg_replace("/".$site_template->start."search_keywords".$site_template->end."/", $search_keywords, $lang['search_no_results']);
 }
}

FIND:
Code: [Select]
  $content = $thumbnails;
  unset($thumbnails);
} // end if
else {

ADD AFTER:
Code: [Select]
if ($count_news == 0) {
  $site_template->register_vars(array(
    "search_keywords" => format_text(stripslashes($org_search_keywords), 2),
    "search_user" => format_text(stripslashes($org_search_user), 2),
    "lang_search_by_keyword" => $lang['search_by_keyword'],
    "lang_search_by_username" => $lang['search_by_username'],
    "lang_new_images_only" => $lang['new_images_only'],
    "lang_search_terms" => $lang['search_terms'],
    "lang_or" => $lang['or'],
    "lang_and" => $lang['and'],
    "lang_category" => $lang['category'],
    "lang_search_fields" => $lang['search_fields'],
    "lang_all_fields" => $lang['all_fields'],
    "lang_name_only" => $lang['name_only'],
    "lang_description_only" => $lang['description_only'],
    "lang_keywords_only" => $lang['keywords_only'],
    "lang_calendar" => $lang['calendar'],
    "category_dropdown" => get_category_dropdown($cat_id)
  ));

  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      if (isset($lang[$key.'_only'])) {
        $additional_field_array['lang_'.$key.'_only'] = $lang[$key.'_only'];
      }
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }
  $content = $site_template->parse_template("search_form");
 }
}

if ($count_news && $show_result == 1)  {
  $founding_title    = '';
  $founding_text     = '';
  $founded_title     = '';
  $founded_text      = '';
  $search_str        = $search_keywords;
  for ($i = 1; $i < $num_newses + 1; $i++) {
      $sql = "SELECT n.news_id, n.news_title, n.news_text, n.user_name, n.news_date
              FROM ".NEWS_TABLE." n
              WHERE n.news_id = $i";
    $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);
 
      $founding_title   = '_';
      $founding_title  .= $news_row[0]['news_title'];
      $founding_text   = '_';
      $founding_text  .= $news_row[0]['news_text'];  
      $founded_title = $news_row[0]['news_title'];
      $founded_text = $news_row[0]['news_text'];
 
      if ((strpos( $founding_title, $search_str ) != 0) ||
          (strpos( $founding_text,  $search_str ) != 0))
      {
$comments =  '';
        $newsPerPage = 5;
        $link_arg = $site_sess->url(ROOT_PATH."search.php?show_result=1");
        include_once(ROOT_PATH.'includes/paging.php');
        $getpaging = new Paging($page, $newsPerPage, $num_news, $link_arg);

        $offset = $getpaging->get_offset();

        $site_template->register_vars(array(
                "lang_calendar" => $lang['calendar'],
                "paging" => $getpaging->get_paging(),
                "paging_stats" => $getpaging->get_paging_stats()
        ));

$comments =  '
<table width="450" border="0" cellspacing="0" cellpadding="0">
         <tr>
          <td class="head1">
         <table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr class="imagerow1">
<td width="100%" valign="top">';
    $comments .=  "<a href=\"./news_headlines.php?id_news=".$news_row[0]['news_id']."\"><b>".$news_row[0]['news_title']."</b></a>".sprintf($lang['news_posted_by'], $news_row[0]['user_name'], format_date($config['date_format']." ".$config['time_format'], $news_row[0]['news_date']));
  $comments .=  '
</td>
    </tr>
    <tr class="imagerow2">
  <td width="100%" valign="top"><br/>';
  $comments .=  format_text($news_row[0]['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));
  $comments .=  '<br/>
</td>
    </tr>
   </table>
      </td>
         </tr>
        </table>';
 
        $content  .= '
      <table width="100%" border="0" cellspacing="1" cellpadding="6" class="forumline">
           <tr>
        <td class="row1">';
             $content .= $comments;
             $content .= '
    </td>
           </tr>
          </table>';
      }
  }
  $site_db->free_result($news_row);
}
else {
 if ($num_rows_all == 0) {

FIND:
Code: [Select]
    }
  }
  $content = $site_template->parse_template("search_form");

ADD AFTER:
Code: [Select]
}
That's all...
Title: [ADDON] Search in News Title and Text ([MOD] Another Simple News Publishing Mod)
Post by: MTsv DN on December 11, 2006, 10:14:48 AM
File news_headlines.php:
Code: [Select]
<?php

$main_template 
'news';
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['id_news']) || isset($_GET['id_news']))
{
$id_news = (intval($_POST['id_news']) ) ? intval($_POST['id_news']) : intval($_GET['id_news']);
if ($id_news)
{
$site_sess->set_session_var("id_news"$id_news);
$session_info['id_news'] = $id_news;
}
}

    
$newsPerPage 100;

$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 n.news_id, n.news_title, n.news_text, n.user_name, n.news_date
            FROM "
.NEWS_TABLE." n
            WHERE n.news_id = 
$id_news";
    
$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 ($news_row[0]['news_id'] != '') {
$comment_user_name htmlspecialchars($news_row[0]['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[0]['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[0]['news_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>";
}

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

//---End Show Guestbook Comments----
$site_template->register_vars(array(
  "news_contents" => $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,
  
"clickstream" => $clickstream
));
unset(
$contents);
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');

?>
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on December 11, 2006, 05:20:55 PM
RSS crashed,  two errors appears if I go to http://www.webax.it/rss.php?action=images

Notice:  Use of undefined constant version - assumed 'version' in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/rss.php on line 42

Notice:  Undefined index:  version in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/rss.php on line 42


These errors occours perhaps after installing MOD Multi-Language support for any text

I have resolved the problem adding to rss.php this code

error_reporting(E_ALL ^ E_NOTICE);
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on December 12, 2006, 10:30:16 AM
Quote
$lang['news_main'] = 'News';
$lang['no_news'] = 'No news';
$lang['news_deleted'] = ' news deleted';
$lang['newss_deleted'] = ' news deleted';
$lang['news_deletion'] = 'News deletion';
$lang['newss'] = 'news';
$lang['news'] = 'news';
$lang['news_modified'] = 'News modified successfully.';
$lang['news_modified_nok'] = 'Error during news modification.';
$lang['news_deletion_confirmation'] = 'Do you really want to delete the %s selected news.';
$lang['edit_news_title'] = 'News #%d posted by %s';
$lang['news_title'] = 'Title';
$lang['news_content'] = 'Content';
$lang['news_date'] = 'Date';
$lang['modify_news'] = 'Edit news';
$lang['news_author'] = 'Author';
$lang['news_add'] = 'Add a news';
$lang['news_add_ok'] = 'News added successfully.';
$lang['news_posted_by'] = ' -- Posted by <b>%s</b> on <i>%s</i>';
$lang['news_archive'] = 'Archives';
$lang['page'] = 'Page';


ITALIAN

$lang['news_main'] = 'Notizie';
$lang['no_news'] = 'Nessuna notizia';
$lang['news_deleted'] = ' notizia cancellata';
$lang['newss_deleted'] = ' notizia cancellata';
$lang['news_deletion'] = 'Cancellazione della notizia';
$lang['newss'] = 'notizie';
$lang['news'] = 'notizia';
$lang['news_modified'] = 'Notizia modificata con successo.';
$lang['news_modified_nok'] = 'Errore durante la modifica.';
$lang['news_deletion_confirmation'] = 'Vuoi veramente cancellare la(e) %s notizia(e) selezionata(e)';
$lang['edit_news_title'] = 'Notizia #%d pubblicata da %s';
$lang['news_title'] = 'Titolo';
$lang['news_content'] = 'Contenuto';
$lang['news_date'] = 'Data';
$lang['modify_news'] = 'Modifica notizia';
$lang['news_author'] = 'Autore';
$lang['news_add'] = 'Aggiungi notizia;
$lang['news_add_ok'] = 'Notizia aggiunta con successo.';
$lang['news_posted_by'] = ' -- Pubblicata da <b>%s</b> il <i>%s</i>';
$lang['news_archive'] = 'Archivio';
$lang['page'] = 'Pagina';
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on December 27, 2006, 09:24:59 PM
Hi! I installed the addon from MTsvDN about search but I have the next error:
Code: [Select]
Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

please could you help me ¿?

__________________________
And i have a problem with Read More.. when i click in the name from the new i go to http://www.yosoyfriki.com/myart/news.php?news_id= then i go to archive section, i would like see only the article that i selected. And I have other problem see it please in my home: http://www.yosoyfriki.com/myart/index.php all the title from the new is up and all articles down... there isn't order.. please could you help me¿?
__________________________
and i would like the users can comment my new.. is it possible?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on December 28, 2006, 12:18:11 AM
Some modifications that i did and works right, maybe i can help you:

index.php
I add a link to the user profile that posted the new.
Find:
Code: [Select]
($new_is_new)?In the same line find the next or something like this:
Code: [Select]
sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));Replace to:
" Posteed by <a href=\"" .$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$image_row['user_id'])."\">".$image_row['user_name']."</a> ".sprintf(format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
_______
Add an avatar or userpic. This changes is to add an userpic from Member picture mod from V@no but with a little modifications this works to avatar mod.

index.php
Find:
Code: [Select]
if (!isset($config['news_home_display']) || $config['news_home_display'] == 1)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT 0, ".((isset($config['news_nb']))?$config['news_nb']:5);
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";
REplace to:
Code: [Select]
if (!isset($config['news_home_display']) || $config['news_home_display'] == 1)
$sql = "SELECT news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT 0, ".((isset($config['news_nb']))?$config['news_nb']:5);
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id, news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";
Now you can use the userpic from the user that posted the new
Find:
Code: [Select]
$news .= "<td width=\"100%\" valign=\"top\">\n<br/>";Add after:
Code: [Select]
if($image_row['userpic'] == "" || $image_row['userpic'] == "blank.gif");
else
$news .= "<a href=\"" .$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$image_row['user_id'])."\"><img src=\"data/userpic/".$image_row['userpic']."\" align=\"left\" border=0 /></a>";

news.php
Find:
Code: [Select]
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)),Add before in line:
Code: [Select]
(($news_row[$i]['userpic'] == "" || $news_row[$i]['userpic'] == "blank.gif")?"":"<a href=\"" .$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$news_row[$i]['user_id'])."\"><img src=\"data/userpic/".$news_row[$i]['userpic']."\" align=\"left\" border=0 /></a>").
Find:
Code: [Select]
$sql = "SELECT news_id, news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT $offset, $newsPerPage";Replace to:
Code: [Select]
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
That's all ^o^

^^ Is the first time that i modify something in php and this works!! I'm happy... although that changes aren't important I hope that I could help someone.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on February 12, 2007, 10:24:33 AM
Hi! I installed the addon from MTsvDN about search but I have the next error:
Code: [Select]
Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279

please could you help me ¿?

__________________________
And i have a problem with Read More.. when i click in the name from the new i go to http://www.yosoyfriki.com/myart/news.php?news_id= then i go to archive section, i would like see only the article that i selected. And I have other problem see it please in my home: http://www.yosoyfriki.com/myart/index.php all the title from the new is up and all articles down... there isn't order.. please could you help me¿?
__________________________
and i would like the users can comment my new.. is it possible?


please... could anyone help me??
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Parasco on February 13, 2007, 08:39:50 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 :/


VERY IMPORTANT
Your news pages will show up blank when you click on archives, but the solution that ACTUALLY works can be found at: http://www.4homepages.de/forum/index.php?topic=6824.15 (http://www.4homepages.de/forum/index.php?topic=6824.15) :D

Enjoy!

PS: Great MOD!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on February 14, 2007, 12:01:13 AM
don't you have an error in search?? Warning: strpos() [function.strpos]: Empty delimiter.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Jenn on February 15, 2007, 10:38:54 PM
Could someone tell me if the code in the very first post is the correct code or are there snippets of code throughout this topic that are needed?

Thanks
Jen
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on February 15, 2007, 11:01:21 PM
Could someone tell me if the code in the very first post is the correct code or are there snippets of code throughout this topic that are needed?

Thanks
Jen

Hi Jenn,
for my site I have followed the first post and then I have applied the modification indicated in the following messages:

http://www.4homepages.de/forum/index.php?topic=9064.msg80021#msg80021

http://www.4homepages.de/forum/index.php?topic=9064.msg43607#msg43607

http://www.4homepages.de/forum/index.php?topic=9064.msg71516#msg71516

http://www.4homepages.de/forum/index.php?topic=9064.msg57321#msg57321

Sorry for my bad english.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Jenn on February 16, 2007, 02:37:26 AM
Thanks so much Alessio :) I appreciate it :)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on February 16, 2007, 02:39:17 PM
Hi i have the next error:
Code: [Select]
Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278

Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279
here: http://www.myart.es/search.htm?search_new_images=1 in search.php

that two lines are:
Code: [Select]
     if ((strpos( $founding_title, $search_str ) != 0) ||
         (strpos( $founding_text,  $search_str ) != 0)){

and a few more lines near them:
Code: [Select]
for ($i = 1; $i < $num_newses + 1; $i++) {
     $sql = "SELECT n.news_title, n.news_text
             FROM ".NEWS_TABLE." n
             WHERE n.news_id = $i";
  $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);

     $row = $site_db->query_firstrow($sql);
     $founding_title   = '_';
     $founding_title  .= $news_row[0]['news_title'];
     $founding_text    = '_';
     $founding_text   .= $news_row[0]['news_text'];
     $founded_title    = $news_row[0]['news_title'];
     $founded_text     = $news_row[0]['news_text'];
     if ((strpos( $founding_title, $search_str ) != 0) ||
         (strpos( $founding_text,  $search_str ) != 0)){
        $count_news++;
     }
     $site_db->free_result($news_row);
 }

please.. i need help.. my version is 1.7.3 and i have this mod installed and work fine but i have this problem in search T_T how could i fix this problem please?
the problem is in [ADDON] Search in News Title and Text ( [MOD]Another Simple News Publishing Mod )
INSTALL: is the code from: Search in news /MTsv DN/
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Jenn on March 20, 2007, 04:03:09 PM
Hola

I've searched all 16 pages, lol. Is it possible to allow users to comment on news?

Thanks much :)

Jen
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on March 22, 2007, 09:07:08 PM
Hola :D

pues.. me lo instalé hace tiempo y desgraciadamente nadie ha hecho ese ADDON a este mod lo siento. Aunque la verdad a mi también me gustaria.. y seguro q a muchos otros usuarios.  Tengo la version 1.7.3 y todo me va bien a escepcion de añadir las noticias al search q me da error

no yet sorry but it would be really great
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MDMC on April 03, 2007, 02:11:08 AM
bei mir wird nix angezeigt wenn ich auf die news.php oder die templates gehe... wenn mit jmd helfen kann bitte per pm, sonst wirds zu unübersichtlich^^
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Jenn on May 14, 2007, 09:22:27 PM
Could anyone help me with this? Pretty please? :)

Hola

I've searched all 16 pages, lol. Is it possible to allow users to comment on news?

Thanks much :)

Jen
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: SnaFy on July 18, 2007, 04:21:14 PM

#-----[ OPEN ]---------------------------------
#
admin/settings.php

#
#-----[ FIND ]---------------------------------
#
Code: [Select]
show_setting_row("highlight_admin", "radio");
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code: [Select]
show_table_separator($setting_group[8], 2, "#setting_group_8");
show_setting_row("news_home_display", "show_news_display_options");
show_setting_row("news_nb");
show_setting_row("news_nb_days");
show_setting_row("news_cutoff");
show_setting_row("news_html", "radio");
show_setting_row("news_bbcode", "radio");
show_setting_row("news_bbcodeimg", "radio");
#
#-----[ FIND ]---------------------------------
#
Code: [Select]
// end of functions
#
#-----[ BEFORE, ADD ]------------------------------------------
#
Code: [Select]
function show_news_display_options($setting_name, $setting_value) {
  global $news_display_optionlist;
  foreach ($news_display_optionlist as $key => $val) {
    echo "<input type=\"radio\" name=\"setting_item[".$setting_name."]\" value=\"$key\"";
    if ($setting_value == $key) {
      echo " checked=\"checked\"";
    }
    echo "> ".$val."<br />";
  }
}


hi man i have 4 images 1.7.4 i don't find this step plz help
Title: Re: [MOD]News archive
Post by: Koosje on July 27, 2007, 10:09:58 AM
In this discussion is becomming complecated because there are so many reactions. What I do, I still don't have a news page with the archive. News is very well installed, MySql-database works, the latest news on the frontpage works, news settings works, paging on news.php works. Permissions are set. Is there a new mod with the right modifacations en installation guide.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on July 31, 2007, 07:33:04 PM
Quote
hi man i have 4 images 1.7.4 i don't find this step plz help

Last part in admin/functions.php file. Not admin/settings.php file.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on August 09, 2007, 07:17:46 PM
Is it possible to ask a news item at once by knowing his id like the thumbnails does. This wil ask a link like "details.php?image_id=xx".
A link like news.php?news_id=xx shows the whole page.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on August 09, 2007, 08:06:05 PM
Need work on layout from news.php file.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on August 10, 2007, 06:27:38 PM
@thunderstrike
Can you tell me how, this is to complecated for me? thanks already!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on August 11, 2007, 12:54:42 AM
Right now ... with no affect layout - no possible do (template need parse for no affect).
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 03:38:50 PM
Guys I just integrated the Simple news publishing MOD and have one question:

this is the mod: http://www.4homepages.de/forum/index.php?topic=9064.0

now if you go to ACP and then to the Add news on the right side a form will pop-up with News title and News content.
Now if you click on the news content and get the page source then you see:

<td><p><textarea name="news_text" rows="15" cols="80"></textarea></p></td>

I need to add an ID to that text area like:

<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>

and need to insert a small javascript tag right under that line:

anyone knows how to do that. I spend the last hour looking the different phps and have no clue were this form is rendered.

thanx.

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 03:44:46 PM
In admin/admin_functions.php file,

find:

Quote
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";

replace:

Code: [Select]
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" id=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";

This will add ID in textarea with variable name.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 04:20:40 PM
Thank you thunder my man,
if I want to address this field with JavaScript were should I put the script.
If I echo it right under that line it gives err..

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 04:37:56 PM
Quote
if I want to address this field with JavaScript were should I put the script.

In admin/news.php you need add for JS code ...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 05:06:55 PM
..so if you want to have like :

<script language="javascript1.2">bla blah</script>

right under the:

<td><p><textarea name="news_text" rows="15" cols="80"></textarea></p></td>

how do  you do that.

sorry for being pain in the neck with this...the code is very confusing.. :lol:

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 05:31:26 PM
Please post JS code ... no code - no can help.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 05:35:04 PM
I need this code:
<script language="javascript1.2">make_wizz('textfield');</script>

to address the ID of the textfield above.

ms

I already integrated the calls to the outside sccript

ms

PD the final result should be:

<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
<script language="javascript1.2">make_wizz('news_text');</script>

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 06:02:51 PM
Quote
<script language="javascript1.2">make_wizz('textfield');</script>

This need go in admin/admin_global.php file ... from <head> to </head> ...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 06:08:52 PM
Thunder let me show you my entire project so you get the idea:

first look at this:  http://www.wyzz.info/demo.php

this is WYSIWYG javascript based script.

It has only one file to be included in the head and the seccond line bellow the the text array.

however I think the textarea does not support html code so Im not sure if it will work I just realized this.
It would be nice ...

what you think

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 06:24:11 PM
Ok, so now you tawk my language.

// Step 1

Upload wyzz.js file in admin folder.

In admin/index.php file,

find:

Quote
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['charset']; ?>">

add after:

Code: [Select]
<script language="JavaScript" type="text/javascript" src="<?php echo ROOT_PATH "admin/wyzz.js"?>"></script>

// Step 2

In admin/admin_functions.php file,

find:

Quote
global $error, $HTTP_POST_VARS, $textarea_size;

replace:

Code: [Select]
global $error, $HTTP_POST_VARS, $textarea_size, $self_url;

Find (original):

Quote
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";

replace:

Code: [Select]
if (preg_match("/news\.php/", $self_url)) {
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" id=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";
?>
<script language="javascript1.2">
    make_wyzz('<?php echo $name?>');
  </script>
<?php
} else {
echo 
"<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value2)."</textarea></p></td>\n</tr>\n";
}

Should work ...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 09:54:36 PM
no go actually no effect what so ever..I dont see the javascript code with make_wizz beeing put after the text fiels code bellow:

Code: [Select]
<script type="text/javascript" language="javascript" src="./../admin/browserSniffer.js"></script>

    <script type="text/javascript" language="javascript" src="./../admin/calendar.js"></script>
<script language="JavaScript" type="text/javascript" src="./../admin/wyzz/wyzz.js"></script>
[b]this is good however I have included that line by hand[/b]

and latter:

Code: [Select]
<tr class="tablerow2" valign="top">
<td><p class="rowtitle">Content</p></td>
<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
</tr>

should become:

Code: [Select]
<tr class="tablerow2" valign="top">
<td><p class="rowtitle">Content</p></td>
<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
<script language="javascript1.2">make_wizz('news_text');</script>
</tr>

Im not sure what we did upthere
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 16, 2007, 10:03:23 PM
Forgot in index.php for check news file ...

Quote
<script language="javascript1.2">make_wizz('news_text');</script>

replace:

Code: [Select]
<?php
if (preg_match("/news.php/"$script_url)) {
?>

<script language="javascript1.2">make_wizz('news_text');</script>
<?php
}
?>

Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MadSci on September 16, 2007, 11:21:13 PM
no go the script is still no there:

Code: [Select]
<tr class="tablerow">
<td><p class="rowtitle">Title</p></td>
<td><p><input type="text" size="30" name="news_title" value=""></p></td>
</tr>



so the text field will support the html code no ?

ms
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 17, 2007, 01:22:02 AM
Sorry ... I no use this JS code ...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: ccsakuweb on September 22, 2007, 04:30:09 AM
Is it possible to ask a news item at once by knowing his id like the thumbnails does. This wil ask a link like "details.php?image_id=xx".
A link like news.php?news_id=xx shows the whole page.

yes it is.. i have made it now in my site: http://www.myart.es

in news.php
search:
Code: [Select]
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
replace to:
Code: [Select]
if($news_id=="")
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
else
  $sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id AND news_id = ".$news_id." ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 22, 2007, 05:06:53 AM
And change:

Quote
4images_users

to:

Code: [Select]
" . USERS_TABLE . "

in code. ;)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on September 22, 2007, 11:48:41 PM
Thanks for the information. But when i've changed the two tips, mentioned above i've got an unexpected error, and the news pages are empty.................
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on September 23, 2007, 01:03:05 AM
Please read step 6 of my signature. What is say / do for unexpected error message ? What is exact error text ?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on October 17, 2007, 08:53:50 AM
Please read step 6 of my signature. What is say / do for unexpected error message ? What is exact error text ?


the error message is : "An unexpected error has occured. Please try again later"
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on October 17, 2007, 01:00:09 PM
Login in admin level of gallery and see again. You see error message in detail.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on October 17, 2007, 05:02:33 PM
But it did work before the changes, so I have undone the changes.
DB Error Bad SQL Query: SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM deplane_news news, deplane_users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT 0, 5 Unknown table 'users' in field list
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: thunderstrike on October 17, 2007, 08:12:34 PM
Replace:

Quote
deplane_users

with:

Code: [Select]
deplane_users users
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Mr_LovaLove on October 18, 2007, 06:50:15 PM
really i got confuse lOol !!


soi spent about 2 days trying up and down to run this mod on my site usig ( 1.7.4 version ) so i end with several questions:

1- why the archieve is not working and how does it work ?
2-Allow HTML in news is for wht ?
3-Allow BB-Code in news not working
4- Allow images (BB-Code) in news not working but b4 that how does it work

also i try tinymce
http://www.4homepages.de/forum/index.php?topic=16639.0

Nothing work :@ the only thing works with me was the news in home.html


any helper around
 
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Koosje on October 18, 2007, 06:59:14 PM
All the time the news is appearing on the frontpage, but as soon I click for more news, the error message is gone but no news is showing up. Only the working paging. The header is saying "No news" while there are more as 10 newsmessages. I've the next changes in news.php in the root section:

if($news_id=="")
   $sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, deplane_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
   else
    $sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, deplane_users users WHERE users.user_id = news.user_id AND news_id = ".$news_id." ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
   
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: stormdesign on February 02, 2008, 04:30:45 PM
I'm trying to see only the news indicated by link... news.php?news_id=8

but the link loads every news from the site

does anyone knows how to fix this?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: beule on July 10, 2008, 07:31:57 PM
Hello, what code must i change that the NEWS-Text iss in the middle of the table? html < c e n t e r > TEXT < / ce n t e r > doesnt work! and in admin-settings the script doesnt save any changes in the news-category!

Hallo, welchen Code muss ich ändern damit die NEWS in der Mitte von der Tabelle steht? html < c e n t e r > TEXT < / ce n t e r > funktioniert nicht! und in den admin-settings speichert das Script meine einstellungen in der news-category nicht ab!

kann jemand helfen?

URL http://www.porno-prignitz.de
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: UnionerDirk on July 21, 2008, 10:53:02 PM
Hatte das Problem bis gerade auch und habe eine Lösung gefunden.  8)

Suche in der index.php nach

?$config['news_html']:0),

ändere die 0 in eine 1 und lade die Datei wieder hoch. Danach gehen die html-Codes
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: beule on August 12, 2008, 10:52:10 PM
hey danke jetzt klappts wunderbar!  :mrgreen:
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on August 27, 2008, 03:31:07 PM
My RSS doesn't work correctly if are present links in the news text, why?
http://www.webax.it/rss.php?action=images (http://www.webax.it/rss.php?action=images)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on August 31, 2008, 02:28:07 PM
My RSS doesn't work correctly if are present links in the news text, why?
http://www.webax.it/rss.php?action=images (http://www.webax.it/rss.php?action=images)

I have understood that html code is not compatible with the RSS. So, how can I add a hyperlink to the news?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: crs on September 07, 2008, 03:32:48 PM
My Newstitle is now "Posté par Nickname le 07.09.2008 15:00"

Why this isn´t in English? I want to fix this problem, anyone can help me?

I´ve edited and uploaded the file "/lang/english/main.php" but it wouldn´t work :(


And i got a second Problem in the Admincenter under the News Display mode:

Fatal error: Call to undefined function show_news_display_options() in /usr/export/www/vhosts/funnetwork/hosting/autospotter/4images/admin/settings.php on line 161
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Alessio on October 14, 2008, 09:06:25 AM
My Newstitle is now "Posté par Nickname le 07.09.2008 15:00"

Why this isn´t in English? I want to fix this problem, anyone can help me?

I´ve edited and uploaded the file "/lang/english/main.php" but it wouldn´t work :(


And i got a second Problem in the Admincenter under the News Display mode:

Fatal error: Call to undefined function show_news_display_options() in /usr/export/www/vhosts/funnetwork/hosting/autospotter/4images/admin/settings.php on line 161

Can you post here the main.php file?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: crs on December 01, 2008, 11:36:48 PM
Hallo, mein altes Problem hat sich erledigt! ;)

Dafür wollte ich mal nachfragen, ob es möglich ist, dass User die News kommentieren können?
Das wäre super!

Danke
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: mongozero on January 14, 2009, 05:23:03 AM
How can I show the news in other section of the gallery, for example on details or categories?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: mawenzi on January 14, 2009, 09:19:52 AM
@mongozero

- add the code section //--- Show news --- in details.php like in index.php ...
- and add the same code section as for template/default/home.htm in template/default/details.htm ...

... and for categories it is to in the same way ...
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: MaxMoto on February 07, 2009, 01:19:51 PM
Hallo,

sehr gutes MOD und schnell und ohne fehler installiert mit dem Forum hier....

Nun würde mich eins interessieren....

1. ist es möglich das nur regestrierte User einer bestimmten Gruppe diese news lesen dürfen, am besten das ich das einzeln für jede News einstellen kann welche Gruppe es lesen darf
2. lese ich imemr was von Kategorien ????? wo kann ich dies einstellen?

3. klitzekleinen fehler in der  der search.php wenn ich als user angemeldet bin:
Quote
Notice: Undefined index: new_cutoff in /home/xxxxxxxx/public_html/xxxxxx/includes/functions.php on line 312

bin ich ausgeloggt ist der fehler nicht da ???? was könnte das sein?

Könnte das jemand in english schreiben meins reicht dafür nicht wirklich aus *schäm*
Title: Fehlermeldung DB Error!
Post by: beule on September 15, 2009, 07:36:46 PM
Hallo,

ich hab da son kleines Problem, wenn ich die Kategorien im Menü links untereinander anzeigen lassen möchte gehe ich wie die Bilder zeigen so vor und dann kommt diese Fehlermeldung und meine NEWS sind komplett weg, woran könnte das liegen? PS: Wenn ich nen alten Backup wieder draufspiele ist alles wieder so wie im Bild1!

Danke für eventuelle Hilfe...!

Bild1
(http://www.abload.de/img/11qxp.jpg)
Bild2
(http://www.abload.de/img/26u15.jpg)
Bild3
(http://www.abload.de/img/3ioi0.jpg)
Bild4
(http://www.abload.de/img/4puxr.jpg)
Title: Re: Fehlermeldung DB Error!
Post by: beule on September 15, 2009, 08:06:36 PM
ja die news mod (http://www.4homepages.de/forum/index.php?topic=9064.0) hab ich von hier, aber wenn ich den backup wiederherstelle dann ist es wie im bild eins bloß das die kategorien wieder nebeneinander stehen!

Es ist egal was ich in den Einstellungen ändere, es kommt immer diese Fehlermeldung!
Title: Re: Fehlermeldung DB Error!
Post by: beule on September 15, 2009, 10:30:29 PM
Ja die tabellen existieren, ich hab die cat_cells jetzt via phpadmin auf 1 geändert, dann kommt kein Fehler, aber wenn ich unter settings was ändere ist es der gleiche Fehler! Komisch!

(http://www.abload.de/img/zwischenablage01l0xd.jpg)
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: V@no on September 16, 2009, 03:08:35 AM
what about news section in your settings? does it exist? does it save your changes?
in database must be present news_nb entry in your prigntiz_settings
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Sunny C. on February 24, 2010, 04:43:41 PM
Schade, dass das Newsarchiv nicht funktioniert!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Sunny C. on May 26, 2010, 05:52:11 PM
Wie kann ich die News so ausgeben?
Code: [Select]
<div>
<div class="contentpaneopen">

      <div class="create_date">
        <span class="date"> 12 </span><br />
    <span class="month"> Oktober </span><br />
    <span class="year"> 2010 </span><br />
      </div>
      <h2 class="contentheading">

        <a href="url.php" class="contentpagetitle"> Test News</a>
      </h2>
      <div class="article-tools">
    <div class="article-meta">
            <span class="written_by">
      Geschrieben von: Administrator</span></div>
        <div class="buttonheading"></div>
          </div>
      <div class="article-content">

        <p align="left"><strong>Test News</strong></p>
<div align="left"><br /></div>
      </div>
    </a>
  </div>

<span class="article_separator">&nbsp;</span>  </div>

?? Ich bekomme das in der index.php so nicht bearbeitet!
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Sunny C. on June 03, 2010, 09:29:49 AM
Was kann ich da tun?
Quote
DB Error: Bad SQL Query: SELECT news_title, news_text, user_name, news_date FROM 4images_news ORDER BY news_date DESC LIMIT 0,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /is/htdocs/wp1189343_OX40HRKULQ/www/gau-pc/portal/includes/db_mysql.php on line 116

Kann mir jemand helfen? Das ist erst passiert, als ich folgendes machen sollte

#
#-----[ OPEN ]---------------------------------
#
index.php

#
#-----[ FIND ]---------------------------------
#
unset($categories);

#
#-----[ AFTER, ADD ]------------------------------------------
#

//-----------------------------------------------------
// ----- Show news ------------------------------------
//-----------------------------------------------------

if (!isset($config['news_home_display']) || $config['news_home_display'] == 1)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." ORDER BY news_date DESC LIMIT 0, ".((isset($config['news_nb']))?$config['news_nb']:5);
else if ($config['news_home_display'] == 2)
$sql = "SELECT news_title, news_text, user_name, news_date FROM ".NEWS_TABLE." WHERE news_date > ".(time() - ((isset($config['news_nb_days']))?$config['news_nb_days']:15)*86400)." ORDER BY news_date DESC";

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

if (!$num_rows)  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $news .= $lang['no_news'];
  $news .= "</td></tr></table>";
}
else  {
  $news = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";

  while ($image_row = $site_db->fetch_array($result))
  {
    $news .= "<tr class=\"imagerow1\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n";
    $new_is_new = ($image_row['news_date'] > time() - ((isset($config['news_cutoff']))?$config['news_cutoff']:3)*86400);
$news .= "<b>".$image_row['news_title']."</b>".(($new_is_new)?" <sup class=\"new\">".$lang['new']."</sup>":"").sprintf($lang['news_posted_by'], $image_row['user_name'], format_date($config['date_format']." ".$config['time_format'], $image_row['news_date']));
    $news .= "\n</td>\n";
    $news .= "</tr>\n";

    $news .= "<tr class=\"imagerow2\">\n";
    $news .= "<td width=\"100%\" valign=\"top\">\n<br/>";
$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));
$news .= "<br/><br/>\n</td>\n";
    $news .= "</tr>\n";

  } // end while

  $news .= "</table>\n";
} // end else

$site_template->register_vars(array(
"news" => $news,
"news_archives" => $lang['news_archive'],
"news_main" => $lang['news_main']
));
unset($news);
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Sunny C. on June 24, 2010, 10:41:01 AM
Ein Kommentarsystem dafür kann niemand erstellen oder? Das fehlt dem Mod noch!

Ps.: Wenn das [http://www.4homepages.de/forum/index.php?topic=6824.0] die gleiche Mod ist, warum werden die Thread nicht zusammegelegt?
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: Sam67 on May 29, 2011, 11:20:53 AM
Ich bin schon länger am probieren wie man die News so ausgeben kann,
daß zwei News nebeneinander ausgegeben werden.
Soll heißen wenn im ACP eingestellt ist, daß die letzten 6 News ausgegeben werden auf der Index,
sollte dies eine Tabelle sein mit 3 Zeilen und 2 Zellen.
Würde mich freuen wenn mir jemand helfen kann, bringe das leider selbst nicht hin.
Title: Re: [MOD]Another Simple News Publishing Mod
Post by: SilverShadow on July 16, 2011, 06:16:21 PM
I've used this mod for a pretty long time, but suddenly I've got that 116 error from a couple of days ago.
I failed to restore my backup and Googled that issue with no hope, but after some workaround I got it fixed and here is what I did

Go to ACP > Settings > News
News display mode : Show news of the last 'X' days
News number : 6
Days number : 1000


Title: Re: [MOD]Another Simple News Publishing Mod
Post by: marcinos on March 02, 2012, 09:02:30 PM
why not I displayed bbcode innews.php, in index.php everything is ok