Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support PHP vs iframes
Ghizza
Posted on 18 May 2007, 12:05:03

Access: Member
Total Posts: 2
Joined: 2007-05-18

Hi Chris,
I'm not a fan of iframes. I would like to integrate n13news in my website using PHP only.
But... why does this work:

Code:
<iframe src="n13news/index.php?cat=mycategory" width="100%" height="100%"></iframe>

and this NOT?!

Code:
<?php
include "n13news/index.php?cat=mycategory";
?>

Another question... is there a way to manually set the number of news I want to display in a page? Like I did on Cutenews ($number = "5";).
Thanks.

Ghizza.
#126
Chris
Posted on 18 May 2007, 12:19:03

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Hey Ghizza,

When including the page via PHP just do

Code:
<?php
include ('n13news/index.php');
?>


Then in the address bar add cat=mycategory to the page you've included the script into.

And to set the amount of news you want to show per page can be done by going to the system config section and editing the news per page setting :new_smiley:
#127
Last edited by Chris at 2007-05-18 12:26:24 Reason:
Ghizza
Posted on 18 May 2007, 21:51:59

Access: Member
Total Posts: 2
Joined: 2007-05-18

Ok, I can view the category I want manually adding ?cat= etc. in the address bar... but how do I display the news of a specific category?
I mean, exactly like Cutenews does with ($category = "5";).

About the number of news in a page, I know I can set a default number in the configuration, but my needs are more complex.
I have to display more than a "block" of headers or news in a single page, divided by categories, and each "block" with a different number of items.

I don't know if all this is possible.
It was very simple with Cutenews, but unfortunately that software has a major security bug and I can't use it anymore.
I hope your great n13news can solve my problems!

Ciao.
Ghizza.
#128
Chris
Posted on 22 May 2007, 09:50:03

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

By adding the ?cat=something to the address bar you are actually viewing the news for that category.

To display different amounts of news per category, if you open index.php and find the lines

Code:
$sql = "SELECT nppage FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$nppage = mysql_result($query,0);


and change them to

Code:
if(!$nnpage){
$sql = "SELECT nppage FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$nppage = mysql_result($query,0);
}


now when you are including your news using the include function put $nnpage = 5; just before it.

Code:
$nnpage = 5;
include ('n13news/index.php');
#129
Last edited by Chris at 2007-05-22 10:55:17 Reason:
Xgeninsinx
Posted on 08 Nov 2007, 19:25:24

Access: Member
Total Posts: 1
Joined: 2007-05-18

I think he means that when visitors come they directly see that catagory. I need this too so thats why i repply xD. :cheese:
#134
Network-13.com © 2013