FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » My News hack
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
My News hack [message #162735] Sat, 10 July 2010 05:26 Go to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I don't know if anyone could make any use of this, but this is what I am using and it works fine for me.

One change that I have been to lazy to do, is that the defined forum for news items could be a GLOBALS variable. I have just entered it directly into the code on line 190 and 191 in news.php.t

The code is surely poor and most likely unsafe, but it works for me!



What it does is:
It takes the first post in each topic created in a specified forum and displays them, offering links to comment on the news article.

The read/unread icon on the comments is wrong at the moment, it only checks against "Mark all forums read" clicks. I'll fix that some year.


I have a bunch of specializations done in my other template files depending on what forum is being browsed, in my news forum, i have one layout for a post depending if its the root_msg and one if its a post that follows, this is a little bit trickier to share, since its so dependant on my own CSS and layouts etc.

Anyways, this code SHOULD work off the bat to at least emulate a news page.
  • Attachment: news.zip
    (Size: 5.43KB, Downloaded 251 times)


Re: My News hack [message #162736 is a reply to message #162735] Sat, 10 July 2010 05:27 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I have not tried this code on any other installation of FUDforum than my own, I have no idea if it works on other versions. I can to some tiny extent try to help you adopt it if there isnt already any better versions out there.

Aw: Re: My News hack [message #162738 is a reply to message #162736] Sat, 10 July 2010 09:08 Go to previous messageGo to next message
ToniCE is currently offline  ToniCE   
Messages: 22
Registered: January 2008
Location: Germany
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user

I wrote some more primitive php-code for my forum, but it works for me...

I'll give your code a try on my FUD 3.0.0 installation, when temperature here becomes more comfortable. Smile
Re: Aw: Re: My News hack [message #162749 is a reply to message #162738] Sun, 11 July 2010 04:47 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
I've tested your hack and noticed a couple of problems that should be fixed:

1. Not generic - it will add a "About Ginnunga" section to your site.
2. Links doesn't work. It assumes that users are using the PATH_INFO theme.
3. Contains hard coded (untranslatable) text in code.
4. Posts with polls will fail: Call to undefined function fud_fetch_poll()

It would be great if you can continue evolving it so we can eventually add it to core.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: New plugin call hook type & OpenID plugin
Next Topic: Search for Attachments
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Dec 18 08:00:11 EST 2017

Total time taken to generate the page: 0.00708 seconds