Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
nSys News System plug-in
#26
I added and simply copied the code and by editor
Reply
#27
Hi, it's working great, but in debug mode I get a bunch of warnings:

In admin:
Code:
Undefined variable: go in ...\nSys\include\functions\classes-admin.php on line 302
Undefined variable: go in ...\nSys\include\functions\classes-admin.php on line 28
Undefined index: page in ...\nSys\include\functions\classes-admin.php on line 62
...

And a lot more, also on the public side.
If you could define those variable, please. It'll make life better to developers 8-)
Reply
#28
Oleg06 Wrote:I added and simply copied the code and by editor
I added image to my news just as you, uploaded it to files, and copied source, than put it to news, but my text didn't disappear. Can you, then, upload your news file (plugins/nSys/include/news.php) here, so I can see how it's written there, and try to find the solution...

Thanks.
Reply
#29
pauloc Wrote:Hi, it's working great, but in debug mode I get a bunch of warnings:

In admin:
Code:
Undefined variable: go in ...\nSys\include\functions\classes-admin.php on line 302
Undefined variable: go in ...\nSys\include\functions\classes-admin.php on line 28
Undefined index: page in ...\nSys\include\functions\classes-admin.php on line 62
...

And a lot more, also on the public side.
If you could define those variable, please. It'll make life better to developers 8-)
Thanks man, I didn't run it in debug mode, so I was unaware of these messages Smile
I don't see any error messages now, in debug mode, I think I defined them all Smile

Download link is updated, new archive attached in second post, and new version uploaded to test links. Test links now run in debug mode too Smile

I hope the life is better now Big Grin
Reply
#30
Sorry but... still getting some Notices, only in the admin:
Code:
Notice: Undefined index: name in ...GetSimple/plugins/nSys/include/functions/classes-admin.php  on line 143
Notice: Undefined index: desc in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 144
Notice: Undefined index: catid in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 145
Notice: Undefined variable: forma in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 259
Notice: Undefined variable: n in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 261
Notice: Undefined variable: n in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 262
Notice: Undefined variable: go in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 265

And can't get news' details an the public side. Check it here: http://quimera.ws/GetSimple/news/
Sorry to bother, but your news system is much better than mine, so I've given up with vudu_news.
Reply
#31
pauloc Wrote:Sorry but... still getting some Notices, only in the admin:
Code:
Notice: Undefined index: name in ...GetSimple/plugins/nSys/include/functions/classes-admin.php  on line 143
Notice: Undefined index: desc in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 144
Notice: Undefined index: catid in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 145
Notice: Undefined variable: forma in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 259
Notice: Undefined variable: n in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 261
Notice: Undefined variable: n in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 262
Notice: Undefined variable: go in ...GetSimple/plugins/nSys/include/functions/classes-admin.php on line 265

And can't get news' details an the public side. Check it here: http://quimera.ws/GetSimple/news/
Sorry to bother, but your news system is much better than mine, so I've given up with vudu_news.
No, you're not bothering at all, I fixed all undefined variables that I encountered on in debug mode, but I will define every var. in classes and classes-admin, so there won't be possible errors Smile

You're using mod_rewrite, right?
I was thinking about functionality with mod_rewrite, but didn't try it yet. I will fix this, I'll have to add some lines to .htacces probably, and just set it choose to work with ? and & (if it's disabled) or with mod_rewrite (if enabled), depending on GS configuration.

Thanks for notes Smile
Reply
#32
Yes, I'm using mod_rewrite.

Quote:I was thinking about functionality with mod_rewrite, but didn't try it yet. I will fix this, I'll have to add some lines to .htacces probably, and just set it choose to work with ? and & (if it's disabled) or with mod_rewrite (if enabled), depending on GS configuration.
This would be great.

Thanks for your efforts.
Reply
#33
I defined all variables that I could find in classes-admin.php, so I think there shouldn't be problems now Smile

For mod_rewrite, I'm still working, 'cause I had some problems when testing on localhost, when I make it to work, then other pages don't work that way, so I'm still figuring it out Smile
Reply
#34
pauloc Wrote:Yes, I'm using mod_rewrite.

Quote:I was thinking about functionality with mod_rewrite, but didn't try it yet. I will fix this, I'll have to add some lines to .htacces probably, and just set it choose to work with ? and & (if it's disabled) or with mod_rewrite (if enabled), depending on GS configuration.
This would be great.

Thanks for your efforts.
I made something with .htaccess and it works on my server.

Download lik is updated, archive re-attached Smile

You can change your .htaccess file to this (of course edit RewriteBase):
Quote:AddDefaultCharset UTF-8

RewriteEngine on
RewriteBase /test/scripts/GS-test/


RewriteRule /?([A-Za-z0-9-]+)/([0-9])/?$ index.php?do=$1&newsid=$2 [QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9-]+)/?$ index.php?id=$1 [QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule /?([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+)/?$ index.php?id=$1&do=$2&newsid=$3 [QSA]

But, I will make it to recognize your old .htaccess file and to alter it according to nSys needs Smile
Reply
#35
Hello!
I suppose `Number of shown news` in `Configuration` doesn`t work.
I tried to change it to 3. But still there are all the news is shown at main page...
I checked config.php file in /include folder:
$nSysNewsShow = `3`;

Could you help me with that?
Reply
#36
umbor1986 Wrote:Hello!
I suppose `Number of shown news` in `Configuration` doesn`t work.
I tried to change it to 3. But still there are all the news is shown at main page...
I checked config.php file in /include folder:
$nSysNewsShow = `3`;

Could you help me with that?
Hello Smile

I'm sorry, I didn't spot that error, I altered the function for showing news, from original stand-alone script to Get Simple, and I mistakenly deleted the line that limit number of news (dumb Big Grin).

It's all right now, archive is re-attached Smile

Download link.

Thanks.
Reply
#37
Ups, download link's gone!!!
Reply
#38
pauloc Wrote:Ups, download link's gone!!!
It's back now Smile
Reply
#39
News not showing up --- 403 error.
Notice: Constant GSIMAGEWIDTH already defined in /Applications/MAMP/htdocs/x/gsconfig.php on line 16

Notice: Constant GSDEBUG already defined in /Applications/MAMP/htdocs/x/gsconfig.php on line 19

Notice: Constant GSEDITORTOOL already defined in /Applications/MAMP/htdocs/x/gsconfig.php on line 31

Notice: Constant GSEDITORLANG already defined in /Applications/MAMP/htdocs/x/gsconfig.php on line 34

--- double posting when writing one post (news)

Bunch of error in admin.

Plugins wnat to read from /more catalog
Reply
#40
Its ok with numbers of news on main page. Thank you!

Some errors (maybe only i have it):
1. news couldnt be edited or deleted
2. and when i change chmod of file nSys/include/news.php to 666 - i can edit news, but when i delete 1 of them, they all have been disappeared. And then added news duplicate.

And could you tell me how can i change the number of simbols in preview of the news that displayed on main page?
Reply
#41
Hi,
I like your plugin but i can't figure out how to add facebook like button to every news.

Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?phpget_page_url(); ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

could you help please?

and this is notice in debug mode

Code:
Notice: Undefined offset: 60 in /srv/http/cos/plugins/nSys/include/functions/classes.php on line 662

Notice: Undefined offset: 62 in /srv/http/cos/plugins/nSys/include/functions/classes.php on line 662

Notice: Undefined offset: 60 in /srv/http/cos/plugins/nSys/include/functions/classes.php on line 662

Notice: Undefined offset: 62 in /srv/http/cos/plugins/nSys/include/functions/classes.php on line 662
Reply
#42
Hi, first of all, thanks for this wonderful plugin.

Now then, I must clarify first that I'm a newbie and I don't really know much about programming but I hoped I found a way to implement RSS Feeds for this news system... Alas, I failed. I tried creating a copy of Displaynews and hacking it to do what I thought should work, but when I put it in the classes.php file the whole CMS goes completely blank, even without actually getting around to call the function.

Maybe you can help me here to learn what I did wrong and what I should change? I think it would be a great thing if this news system had RSS feeds.

Thanks in advance.

Code:
class Rss extends CheckFilesAndFolders{

      var $path=__FILE__;
      
      function DisplayRSS($cat="",$newsid=NULL,$c=NULL){

          global $nSysNewsShort, $nSysLoc, $nSysNewsShow, $nsys_dir;

                    $path    = GSDATAOTHERPATH;                    

                    $file2    = 'cp_settings.xml';

                    $data2    = getXML($path . $file2);

                    $FURLS    =  $data2->PRETTYURLS;

          if(isset($_GET["newsid"]))

        {

              $newsid=$_GET["newsid"];

        }

          $path=explode("include",$this->path);

          $path=$nsys_dir;

          $file=$path."include/news.php";

          if ((isset($_SERVER['QUERY_STRING']) && trim($_SERVER['QUERY_STRING']) != ''))

          {

              if(stristr($_SERVER['QUERY_STRING'], 'do='))

              {

                  if($FURLS==1) { $query = '/'.preg_replace('/id=\d+/', 'id=', $_SERVER['QUERY_STRING']).'/'; }

                else { $query = '?'.preg_replace('/do=\d+/', 'do=', $_SERVER['QUERY_STRING']); }

              }

              else

              {

                  if($FURLS==1) { $query = str_replace("id=","",$_SERVER['QUERY_STRING']).'/'; }

                else { $query = '?'.$_SERVER['QUERY_STRING'].'&do='; }

              }

          }

          else

          {

              if($FURLS==1) { $query = ''; }

            else { $query = '?do='; }

          }

          if (isset($_GET["do"])&&($_GET["do"]=="archives"))

          {

              $limit=count(file($file));

              $older="";

          }

          else

          {

              $limit=$nSysNewsShow;

              $older=$this->aOpen($query."archives","",LangArchives).$this->aClose();

          }

          $fp=file($file);

          $i=0;

          if ($cat=="")

          {

              $cat = 1;

          }

          if($newsid==NULL)

          {

        $go  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
        $go .= "<rss version=\"2.0\">\n";
        $go .= "<channel>";
        $go .= "<title>The title of my RSS 2.0 Feed</title>";
        $go .= "<link>http://www.example.com/</link>";
        $go .= "<description>This is my rss 2 feed description</description>";
        $go .= "<lastBuildDate>Mon, 12 Sep 2005 18:37:00 GMT</lastBuildDate>";
        $go .= "<language>en-us</language>";

              foreach($fp as $num => $n)

              {

                if(!preg_match("/^<\?/",$n))

                  {

                    //$n = str_replace("\n","<br />",$n);

                      $n = explode("|",$n);

                      if (($n[7]==$cat)&&($i<$limit))

                      {

                          //$n[6] = str_replace("<br />","",$n[6]);

                          if($FURLS==1) { $link=$query."more/$n[0]"; }

                        else { $link=$query."more&newsid=$n[0]"; }

                          $lenght=strlen($n[4]); $rmore="";

                          if(($nSysNewsShort>0)&&($nSysNewsShort<$lenght)) { $lenght=$nSysNewsShort; $rmore="... ".$this->aOpen("$link","","[".LangReadMore."]").$this->aClose(); }

                          #$n[4] = substr($n[4],0,$lenght).$rmore;

                          $n[4] = stripslashes($n[4]);



                          /*

                             * $n[1] - News date and time

                             * $n[2] - News author

                             * $n[3] - News title

                             * $n[4] - News text

                             * $n[5] - Number of Views

                             * $n[6] - Number of Comments

                          */

                          $go .= "<item>\n";

                          $go .= "<title>$n3</title>\n";
                          $go .= "<link>$link</link>\n";
                          $go .= "<guid>$link</guid>\n";
                          $go .= "<description>[CDATA[".$this->Paragraph($this->BBCode($n[4]).$rmore."]]</description>\n";
                          $go .= "<pubDate>$n1</pubDate>\n";

                          $go .= "</item>\n";

                          $i++;

                          $c++;

                      }

                  }

              }

              if($c==0)

              {

                  $go .= $this->DivOpen("error","TopFull Error");

                  $go .= LangNoArticles."! <br />";

                  $go .= $this->DivClose();

              }

              else

              {

                  $go .= $older;

              }
          $go .= "</channel>\n";
          $go .= "</rss>\n";


          }

          else

          {

              $go = $this->DisplaySingleNews($newsid);

          }

          return $go;

      }
  }
Reply
#43
Ok, turns out that:

1. I did not need to setup a whole new class for it, I simply attached it to the News class.
b. There was a parenthesis missing, and to read it I just needed to set the CMS to debug=true

I still haven't tested but I thought about posting here as soon as I found out so no one wastes their time on this.

Now, for this to work, all you need is to create a new template with the following code on it:

Code:
<?php

require(GSROOTPATH."plugins/nSys/lang/en.php");

require(GSROOTPATH."plugins/nSys/include/config.php");

$news = new News();

echo $news->DisplayRss(1);

?>

and that should be it.

Please, though, there are some things still missing. The following should be dynamical:

Code:
$go .= "<title>The title of my RSS 2.0 Feed</title>";
        $go .= "<link>http://www.example.com/</link>";
        $go .= "<description>This is my rss 2 feed description</description>";

Any thoughts?
Reply
#44
Hi all)

How to not show page content if displayed news?
I created a page site.com/news, created a template file news.php and put code to show news.
What to do now so that when the news show, not displayed page through get_page_content ();?

sorry for my english)

---
Как не выводить страницы, если выводятся новости?
Я создал страницу site.com/news, создал файл в шаблоне news.php и вставил туда код показа новостей.
Как теперь сделать так, чтобы когда показываются новости, не выводились страницы через get_page_content();?
Я в PHP Не понимаю. Пробовал что-то делать с оператором IF, но так и не получилось сделать.
Sorry for my English ;)
Reply
#45
You could just remove get_page_content() from your template file, if you don’t want to display any page content you wont be needing it.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#46
I need to show get_page_content () on the main page, and news on the other. I just do not work output of all news (/archive/).

Maybe you can do a background check through IF? If you see news, the hidden get_page_content ()
Sorry for my English ;)
Reply
#47
If you have your standard template file (default.php I guess) and you have a template file only for your news page (news.php) then you can just remove get_page_content() from news.php. All pages that still need get_page_content() will just use the default template file and still display the content.

You should use multiple templates, that way you can hide the content from one template and still display it for others.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#48
I'm talking about viewing the full news with the comment form)
If I go to a full news, I see there and the main page which is displayed in template.php which is output from get_page_content ()

View news through file news.php without get_page_content () is works.
If you go to the full news( more/news_id ), I see more and that the main output
Sorry for my English ;)
Reply
#49
Hi again
I try to write function for Like button but phpget_page_url() is not working, how can i get it works.
I try both " ' quotation mark none of them working Smile . (My PHP experience is zero)
Code:
function LikeNews(){
    $go = "";
    $go .= "<iframe src=\"http://www.facebook.com/plugins/like.php?href='.phpget_page_url().'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:80px;\" allowTransparency=\"true\"></iframe>";
    return $go;
}
Reply
#50
instead of using a string variable, just echo the string. You don't make any calculations, just prints text data.
And btw, if you use functions or variables inside strings, use " instead of '
example
Code:
function likenews (){
echo "<iframe src=\"http://www.facebook.com/plugins/like.php?href=".phpget_page_url()."&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:80px;\" allowTransparency=\"true\"></iframe>";
}

btw. I have no idea what is an allowtransparency tag


edit: weird, my reply has been cut of in half :\
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 1 Guest(s)