Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How to customize the News.php page?

Asked Modified Viewed 5,184 times
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
asked
Junior Member

Hi

How to customize the News.php page not from root, but from /themes/THEME/news.php.

I see that php-nuke have this option, but not found anything about this in docs or forums.

Anyone know how i can do that?
0 replies

11 posts

S
SimpleVision
S
  • Member, joined since
  • Contributed 63 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

As far as I understand, you are not able to override the default by placing news.php in the theme folder.

But depending on what you want to change, it might be possible to do with the available theme functions
0 replies
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

I will look for this function, but i need to change code not function.

Yep i try to place news.php to theme folder but no change.

Another else?
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

What for?
php-fusion does not work like other cms do!

Did you read the documentation?
0 replies
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

Yes, read but don't find anything like that i need.
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

What do you want to change?
A link to your site?
What version? Which theme do you use?
More information would be helpfull.
0 replies
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

I want change the code(like where need to be place 'readme' and delete info that i not needed)
The site is Offline(127.0.0.1)
I use default theme(Gilette).
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Sorry, it is hard to understand what you mean. I guess you want to change code in the files but not in the theme.make a screenshot if possible...
0 replies
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

hmmm its not so possible.
I can edit news.php directly,... but i need to upgrade the CMS without modifing the all files again and again.
I need to make changes only in theme folder. like :
/themes/MyTheme/theme.php
/themes/MyTheme/news.php
/themes/MyTheme/articles.php
/themes/MyTheme/gallery.php
0 replies
H
Harly
H
Harly 10
Regards, Har1y.
  • Senior Member, joined since
  • Contributed 302 posts on the community forums.
  • Started 51 threads in the forums
answered
Senior Member

I've read your posts several times, sasha2002, but I still can't find out what the purpose of all this modding is. What is the result your hoping to achive with this. I mean: what should be the end-result? Can you show us an example, for example from a php-nuke site, where we can see it in action?

You see, it's only a theme issue, if you just want to change the appearence of the news and articles, and maybe a few of the functions of the mentioned (e. g. 'posted by', insted of, the theme bullet, or, for example, the news-footer split into two lines - the poster-info one on the top, and the rest in the bottom of the news/articles - and so on...).
So please explain it a little clearer! ;)
Edited by Harly on 16-01-2011 16:11,
0 replies
S
SimpleVision
S
  • Member, joined since
  • Contributed 63 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

Quote

sasha2002 wrote:
I want change the code(like where need to be place 'readme' and delete info that i not needed)
The site is Offline(127.0.0.1)
I use default theme(Gilette).



you can do this from theme.php or if you so wish you can put some of that logic in news.php in your theme folder.


go to my php-fusion themes and download the 4Newspapers 2.0, then in the theme.php file find render_news function, where you can see an example of how you can add read more link to your news item, and remove all of the information that you don't want.

When page is rendered, news.php file uses render_news from theme.php to "print" out the html. Function render_news can access all of the data about that particular news item via $info array, so if you need to get id of the news item you do the following:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$info['news_id'][/syntaxhighlighter]

you can find all the items of that array at line 56 of /news.php

And this is how the data looks like:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
"news_id" // link to the news item, href="/news.php?readmore=$info['news_id']

"user_id" // link to the user , href="/user.php?lookup=$info['user_id']

"user_name" // self explanatory

"user_status" // dunno

"news_date" // raw date value ( not pretty )

"cat_id" // link to all news in same category, href="/news_cats.php?cat_id=$info['cat_id']

"cat_name" // name of the category of the news item

"news_subject" // title of the news item

"news_ext" // I don't see how this can be used for a theme

"news_reads" // number of views

"news_comments" // number of comments

"news_allow_comments" // true false if comments are allowed

"news_sticky" // true false if news item is sticky [/syntaxhighlighter]


I hope that this was helpful
0 replies
S
sasha2002
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

I would like this style www.portalthemes.com/modules/gallery/albums/Donation-Themes/dodsource.sized.jpg.As you can see in this image, only 'read more' stay on news.php.

Also i need to add some "<div><tr><span>" to the comments.
xmages.net/storage/10/1/0/c/9/upload/4eaf4061.jpeg
0 replies

Category Forum

Themes Support

Labels

None yet

Statistics

  • Views 0 views
  • Posts 11 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

H
H
Harly 10
Regards, Har1y.
  • Senior Member, joined since
  • Contributed 302 posts on the community forums.
  • Started 51 threads in the forums
S
S
  • Member, joined since
  • Contributed 63 posts on the community forums.
  • Started 11 threads in the forums
R
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet