Helpful Information
 
 
Category: vBulletin.org Forum
VB 2.0 plus newspro?

I've seen it for the old 1.1.x but anybdoy try it with 2.0 yet? I use newspro and would like to see it work :)

I would suggest you wait until version 4.0 comes out code named "Coranto". The code has been rewritten from the ground up. I am a alpha tester for it and I know they are working with Matt from ikonboard for an integration between the 2 products....when it is released I may work on it as well....

Originally posted by krohn
I've seen it for the old 1.1.x but anybdoy try it with 2.0 yet? I use newspro and would like to see it work :)

Yeah. Tribalwar did this or made the hack. Anyway.. we havn't switched over to vB 2.0 yet so we haven't created it yet. I don't know if were keeping Newspro, but if we are, were going to get it working soon. :)

Let me know :) I'm weighing out all of my options and looking at things besides newspro too.

I use vB for my news. I wrote a script to grab the latest x posts from my news forum (that aren't closed or invisible) and the replies/views. This works really well because it adds commenting to the news and requires 0 hacking to vb. You already have a permissions control system in place, a template engine, and a search engine. What could be better?

That's very neat! I like to see that News Script leadZERO and see if it could work with out new site!

Well the script is still imature as of yet. The version running on that site is different then my latest one. All the HTML is hard coded into the one that is running, however here is what I have done. I added templates for this version to make it easier to work with.


<?php
chdir( "./forum" );
require( "./global.php" );
chdir( ".." );

/*
Move to CP
$newsForum_ID = 33;
$numberPerPage = 20;
*/
$newsForum_ID = 33;
$numberPerPage = 20;
$newsDateFormat = "l, F d, Y";
$newsTimeFormat = "h:i A";

$stories = $DB_site->query( "
SELECT threadid, dateline, TO_DAYS( FROM_UNIXTIME( dateline,\"%Y-%c-%d\" )) AS day,
postuserid, user.username, user.email, replycount, views, title
FROM thread LEFT JOIN user ON thread.postuserid=user.userid
WHERE forumid=$newsForum_ID AND pollid=0 AND visible=1
ORDER BY day DESC, dateline DESC
LIMIT $numberPerPage;");

$cDay = 0;
while ( $story = $DB_site->fetch_array( $stories ))
{
$date = vbdate( $newsDateFormat, $story[dateline]);
$time = vbdate( $newsTimeFormat, $story[dateline]);

$text = $DB_site->query_first( "SELECT pagetext, dateline FROM post WHERE threadid=$story[threadid] AND userid=$story[postuserid] ORDER BY dateline LIMIT 1;");
$text = bbcodeparse( $text[pagetext], $newsForum_ID );

if ( $cDay != $story[day] )
{
if ( $cDay != 0 )
{
eval( "\$newstext .= \"".gettemplate('news_postdaybit')."\";");
}
eval( "\$newstext .= \"".gettemplate('news_datelinebit')."\";");
eval( "\$newstext .= \"".gettemplate('news_predaybit')."\";");
$cDay = $story[day];
}
eval( "\$newstext .= \"".gettemplate('news_storybit')."\";"); // story text
}
eval( "\$news = \"".gettemplate('news_display')."\";");
?>


Just place that block at the beginning of the news page, it must be placed at the beginning because of cookie settings run through the session.php included from global.php.

Then where I want to put the news I have the line:


<?php echo"$news"; ?>


I'm adding a lot of stuff to this though, support for announcements and polls.

If you would like email me at: ryans@ravingaming.com and I'll let you know when I make changes. I figure its the least I can do since I've used your site as an inspiration for my development. :)

If you need any help with it let me know.

By the way...

The templates I use, and you would need to add are:

news_postdaybit -- after the last story for a day
news_datelinebit -- used to create the date header per day
news_predaybit -- after the dateline but before the first story (this is kind of redundant because it could be included in the dateline template)
news_storybit -- each story
news_display -- main stuff...


Let me know if you have questions about them, if you can't figure out where one template is used turn on the option in vb2 that prints the template name before it, I find that really helpful when working with the templates.

Hmm...

I also forgot to add a URL, but our current site is http://www.ravingaming.com. Although, as in the news, I have a new layout and design in the works. Hopefully in the next week or so I will switch the site over, I hate that current design but then I made it...

when we upgrade to 2.0 i'll get the newspro thing working with it, and release a new version. i've a few additions already that i should've probably put in an upgrade anyways (Comments>> link, etc) but i've been busy with other stuff.

when i have to work on it again to get it working for 2.0 i'll have no excuse not get put out a new one though :P

Rat... ur no fun. :|

I am also interested in both ideas. I downloaded Ratorasniki's hack for NewsPro, but after looking at it, I don't think it'll work to well, because I have 2.0, and I am not sure it'll work with that. I am using ktalk, and I really do not like that program, and I would love to integrate comments into vBulletin. :)

leadZERO, I read this news post:


Well, I spent the last couple days roughing out a new news system that will integrate with the forum software and MySQL database. All I have to say is MySQL rocks... Such a powerful databasing engine. Hopefully in the coming days I will get more elaborate and incorporate new features. Right now it just takes any thread from this forum and makes it into a news item and links to the thread for commenting. (No you can't post your own threads, the permission SHOULD be denied, try it, and if you can let me know, I'd appreciate it.)

Let me know what you think, feel free to PM me or email. I will be writing a script to import all the old news into this forum also, look for that soon.

Your friendly RG administrator,
Ryan "leadZERO" Sommers


I love the little script you wrote, I may try it. I do have one idea for a script though. Maybe have it create different categories depending on the categories in the certain forum. For example:

--Forum: News (Level 1) - This is where normal news will go
---Forum: Gaming News (Level 2) - This is where gaming news will go
---Forum: Tech News....

So on. Then, when you load the news with <?php echo"$news"; ?>, you can specify another forum ID, which is under the main forum ID (specified in the variables) and creates a different category. I think that would be cool.

I hope you understand that, and I am interested in any updates in either of these addons/scripts.

Thanks!!! :)

I'm two steps ahead of you :)

I plan on adding categorical news. Then users can specify what categories they want to view, and it will combine them into one list using different colors or something to seperate categories.

At this point I'm just trying to get my new site design and layout up. Like today I added a "Latest Poll." It loads the latest poll from the news page and puts it on the same page as the news and allows peopel to vote and see the results.

I didn't realize there was such a want for this stuff, I was just developing it because I needed it. But if there are other people out there that want this type of integration I might package it all up when I get all the basic components and release it.

Here is a picture of my dev site (hence the 127.0.0.1 in the URL.

While I'm thinking about it.

I'll make a new post about something... Check it out it will be my latest thread in this forum.

I am with you all the way, I know I want something like that. But, I wouldn't be able to create it. I only know the basics for PHP (if, else, echo, location, etc.).

Thanks.

Headlines. You need headlines. That way you can split catergories into different pages, and have each headline group one a different category, if you know what I mean. :D

Thats today's task. Yesterday I got the first draft of the poll system done. This morning I added polls to the news... This afternoon I will be putting the finals touches on it and then working on headlines. I would like to have like the latest 5-10 news items have direct links at the top. This won't take long since I can insert it into the news generator code. Then after that I will do a "Yesterday's Top Posters" table.

If you have other ideas of things you would like let me know and I will add them.

Cool, so now I get to basically supply with all the suggestions, awesome! :) I posted a message on my Forums, and I may get some responses soon, you never know what people want in this stuff.

But, another suggestion I have...

Something that could add a feature on to the categories. What I will run is a network of sites. Each site having it's own sub-domain. Each sub-domain will run a news script, and I would like this to be based on one central program, so I can have total control. What would be cool, is that you can load a certain category or categories on to one page. (have them mix, like after the newssubject, put the category).

Then, if you want, you can seperate them into page by page for different categories of category.

For example (my main page will have all news on the whole network, seperated by each site)

For example:

My Main Page:

Car Site News
-Headline
-Headline
-Headline
....so on.

Web Site News
-Headline
-Headline
-Headline
....so on.

Tech Site News
-Headline
-Headline
-Headline
....so on.

Then comes the MAIN network website news, the news for my site. But each above headlines link to a different page (eg: index.php?newsid=3)

Then, somehow through variables or the control panel, you can specify what catgories go into what newsid.

Then load them on the pages specified.

Did you get that? If not, tell me, I can try to explain it better. :) I think that'd be cool. I can keep you posted on any other ideas I have.

I kind of get where you are coming from, however at the current time I don't really have a need for that because I only have one site. Perhaps after I get the version for my site working how I want it I will explore options that don't benefit me particularly. The category idea I like but I don't know about all the resorting like you said. However, feel free to email me at the address in my sig or leave me a message on http://www.ravingaming.com/forum. Or post here :)

That's cool. I can understand where your coming from, not really wanting to add things you won't use. Sure, what you're making, would still be awesome. It was just a suggestion. ;)

/me wants to see an interactive demo

Unfortunately I don't have the latest version running on the website yet. However it isn't that different in looks. The other day I added the headline code. It puts the titles of the first x stories in a little table that will be displayed on each page. It also limits the text as to not widen the table beyond a given limit. Then I went ahead and added a column for "(replycount/views)". Yesterday I worked out a hack that allowed individual users to select how they wanted to view posts instead of the site wide variable, http://www.vbulletin.com/forum/showthread.php?s=&threadid=10758. Today I hope to add a "Yesterday's Top Posters" table. The first time someone views the newspage on a day a file will be generated that contains the top x posters from the day before. This will only happen once a day though since it won't change in a 24 hour period, all other views after it will just include the file.

You add news like if you were making a new Thread in the forums, and only allow a certain group to post that... correct? This would be neat cause it save you the trouble from making extra cookies. :)

Yes. Thats why I wrote it like that. You don't add news, you add threads to the forum the news generator reads from. It queries the latest x threads from the forum and shows the first post in each thread. Then the newer version I have also adds the first y to the list of headlines. Also, the newest version takes the newest poll in the news forum and places the poll on the news page. They can vote for the poll on the page or if they have voted it shows the results.

On our site only our staff group has permission to add threads to the forum but everyone has the ability to reply.

/me sends TW staff here again. :)

http://www.ravingaming.com/images/rgv3b3.gif

Here is a screenshot showing the headlines and the poll. I am going to move the headlines onto the sidebar though and have it display on every page.

I can't wait to use that!!! Once I do add, I will be sure to give you credit. Add you to my affiliates list. hehe. :)

Pay no attnetion to that code I posted before. I made the mistake of posting it too early and before I could write some clear instructions. I really meant it as a preview and only for people to run it if they knew a little about PHP and vB; then they could figure out what would need changed.

I've added a lot since then and changed all the template names. However, I might release my latest work on it at the conclusion of the weekend. It just depends on whether I can get it how I like it or not.

Hey Lead,

Php script. Any updates?

leadZERO >>> What version of NewsPro are you using? There is a version 4.0 called "Coranto" and can be downloaded as well, I can send you the info as I am a Alpha/Beta tester. There is a MySQL version being worked on as well and would really be nice to add to this.










privacy (GDPR)