Separate News Pages

Asked by Birch

Well, I installed phpns at my site, but I dunno how to create separate pages for each news. I'm a little new at news scripts, and I ask you, how is it possible to have turned friendly seo pages on, and when you click a title it says Error 404?

Question information

Language:
English Edit question
Status:
Solved
For:
phpns Edit question
Assignee:
No assignee Edit question
Solved by:
alecwh
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Birch (pr-birch) said :
#1

I found how to include the script variable, but I don't know how to use a custom theme with it.

Revision history for this message
Birch (pr-birch) said :
#2

How the heck can I use seperate pages?

Revision history for this message
alecwh (alecwh) said :
#3

Birch,

Please be patient with us, we have jobs/school to attend to!

There was a bug that was found in shownews.php that made SEF URLs return faulty locations. 2.2.3 Patch 1 (go to the website for this) fixes the issue.

Download and update your installation, and try again.

To use separate pages, just activate SEF URLs, post articles, and that's it... just link to the location (Ex: http://example.org/About-us).

Revision history for this message
Birch (pr-birch) said :
#4

Sorry, my problem is not with you. And I was going to include something else in my above message, but who cares. I just wanted to say that I managed to activate sef urls after installing Patch 1

Thanks, but how can I use these separate pages with my custom css template? Because it says "You are viewing the shownews.php file directly! You probably want to include this file, instead of just directly linking to it. For a HOWTO, see the help/manual file.". What to do? Include it to another page? Nah, I will have to do it manually every time.

Revision history for this message
alecwh (alecwh) said :
#5

If that message is bothering you, you can remove it yourself. Open
up /shownews.php (in whatever editor you choose), and navigate to around
line 654.

You will see the following code:

  //if viewing shownews.php directly
  if (strstr($_SERVER['PHP_SELF'], "shownews.php")) {
   echo "<p><strong>You are viewing the shownews.php file directly! You
probably want to include this file, instead of just directly linking to
it.</strong> For a HOWTO, see <a href=\"help.php\">the help/manual
file.</a></p>";
  }

Just remove the whole block.

Revision history for this message
Birch (pr-birch) said :
#6

And then I adjust the shownews.php with my css style and template? Hm, thanks. :D

Revision history for this message
Birch (pr-birch) said :
#7

Thanks alecwh, that solved my question.

Revision history for this message
Birch (pr-birch) said :
#8

Well, I edited the shownews.php to use custom and html template, but then all the generated codes with the shownews include break. What can I do, so that when shownews is viewed directly the html works, and when it is included by other page not? I want to display the news in my index page, and each one separately from shownews.php.

Revision history for this message
Best alecwh (alecwh) said :
#9

Okay, you're doing it wrong. Shownews.php is NOT meant to be linked to
(or shown) directly. It was intended to be included by another PHP
document.

I was a little confused what you wanted. I told you edit out the warning
message that phpns gives in shownews.php, which is the ONLY thing you
should have done with it. No more editing, styling, HTML adding.
Nothing.

So, what you need to do, is have your index include phpns (with any
pre-include variables), and have ANOTHER page, say, single.php, include
phpns too. That way, you can have your index link to single.php for each
of the articles. To do this, you need to use $phpns['script_link'].
Check the docs to see how that works.

Remember, you can use template management to modify the styling/html for
each of the news items.

Preferences -> Template Managment -> New Template

Revision history for this message
Birch (pr-birch) said :
#10

Yes, but that single.php file doesn't have to include any php code in it? It doesn't work. I'm pretty sure it needs something to make it work as a script link.

Revision history for this message
Birch (pr-birch) said :
#11

Oh my, my fault. I mistyped a line of code. Thank you truly, I was to stupid to think that. And you don't know how many php news sctipts I have tried. Thank God I have PHPns!

Thank you for your help and this wonderful application.

Revision history for this message
Birch (pr-birch) said :
#12

Thanks alecwh, that solved my question.

Revision history for this message
jf dg (nmfd44) said :
#13

It relies upon on if you're viewing the unmarried article at a time, or several at a time. If you're viewing the single article, just set a brand new encompass on your <title> tag with a template that indicates only the news name...Then simply include shownews.Php again, with that template, and of course the category you are showing to your present day article. This works nice, I do it on my own websites. See more detail here https://topseokit.com/