PDA

View Full Version : Is there a NewsPro hack for 2.0 b3?


YellowKard
03-26-2001, 01:02 PM
Is there a NewsPro hack for 2.0 b3?

03-27-2001, 04:43 PM
There is one for the final release of v2.0 coming soon.

03-27-2001, 07:13 PM
Great

krohn
04-10-2001, 09:37 AM
How's this coming along?

I go through a TON of news items every day and would love to beta test this hack or something...

RobAC
04-10-2001, 01:09 PM
What is the Newspro feature? I was under the impression, according to John, that no new features would be seen with 2.0 after beta 5?

tubedogg
04-10-2001, 03:51 PM
Rob: There won't be any new features. John Harrison is saying that a hack will be released after the final version of vB2 is released.

krohn
04-10-2001, 09:16 PM
That funky newspro ktalk really sucks :(

Being able to use Vbulletin will rock for the talkback on news!

Imperitus
04-12-2001, 07:43 PM
I made a simple news hack script that works very well with vbull 2 seems compatable with all th betas since I made it for 3...

Thread where I explain it (http://vbulletin.com/forum/showthread.php?threadid=11904)

Feel free to use it if you want, or let me know if you have any questions... :)

GimmeTech
04-18-2001, 03:11 PM
I hope this one is coming. This would be great. Looking forward to it.

Imperitus, The script you wrote says that it takes news in the forums and ripps them. This does not rip newspro stories and put them in the forums for comments to be made on them does it? This is what I am looking for. So far the furthest I have been able to do is add a link in the newpro code that takes you to the forums. It would be real nice if it would post the story in a forum of your choice for comments.

Thank You.

Imperitus
04-18-2001, 03:46 PM
Actualy no. What it does is eliminate the need for newspro entirely.

It works like this.

1 You make forum for news
2 You post stories in that forum, ( I have that forum moderated so only admins and mods can post, and have html turned on so images and layout can be configured.)
3 This script pulls the contents of the posts in said forum and puts them on the news page. Including a link to the thread for easy comments...

GimmeTech
04-18-2001, 04:44 PM
I am interested in talking to you about this further. Any way to do news through my forum software would be real nice. However, my newspro setup is extensive. I have several add-ons installed that do various things. I would have to make sure that I could accomplish what I am currently trying to do before I would be willing to make a switch. I did however look at your site. I was impressed. My main concern is the linking. I have it set up where the top 3 boxes have a total of 10 links to the below articles. The rest are archived. If I could get the look and feel of what I already have, I just might do this. Right now I am using the newscat add-on to accomplish multiple cats with extended linking and archiving.

If you wouldn't mind looking at my site and see if this would be possible with your news script I would be greatly appreciative. Here is my link. You can basically see what I am trying to do and the look I am after from the front page.

I have an estimate to go on, but I'll be back in this evening CST. I'll check on this thread then.

Thank You,

Imperitus
04-18-2001, 04:53 PM
I think what you want to do would be a fairly simple thing to get from my script, it would require a slight modification and a second script to create the links/menu at the top, but it's be fairly simple.

And once done all your stories would be archived and organized in vbulletin for future searching/replying/whatever...

Shoot me an email if you need help modding my script to do that.

In addition I noticed you had ubb, are you looking to switch to vbull? or do you have it already and just still have ubb as well?

GimmeTech
04-18-2001, 05:12 PM
Hello,

If you think you can help me accomplish this, I think it would be great. Yes I purchased UBB Gold (Cough) last month and spent, well you know what they charge, on it and ended up beta testing errors out of the gold version to get it to work for me. Yuck. So I was a little upset to say the least. I'm over it. I decided to purchase vB. Installed it in minutes and WOW. I am happy now. UBB is still on the server so I could pull my information off of it to set up vB. It will most definitley not be used for anything. And this is just my opinion of course. I am sure there would be at least one who would disagree.

But yes, If you go to gtforums from my front page it will take you to Vb. I do have a few links to correct as say the Comments on my news still go to UBB. But that is a newspro link that I haven't worked on yet. If you would like to see my Vb install, click on gtforums at the left in the nav bar. It's pretty much ready to go. I rescheduled the estimate for in the morning. I'll be here in the office the rest of the day. If you would like to correspond, we could meet in my chat room located at my site or by email, whichever you prefer.

Thank You,
Hooper

Imperitus
04-18-2001, 08:14 PM
Okay, here ya go.

This meathod uses three file types.

newspage.php = the page to display the news on. It will have php includes to call the other scripts.

newslinks.php = this script calls the titles of the posts in a forum and makes the menu

newsc.php = pulls the title and content of the posts to make the news stories.

Each category of news will require a newslinks.php and a newsc.php that are set to the thredid of the coresponding forum.

Examples:
newspage.php

----------

<html>
<body>

<?php include('newslinks.php');?>
<br>
<hr>
<br>
<?php include('newsc.php');?>

</body></html>

-----------

newslinks.php
-----------

<?
/* declare some relevant variables */

$DBhost = "your server name or ip";
$DBuser = "the user name for the server";
$DBpass = "the pass word for the server";
$DBName = " the name of the database you're useing for vbulletin";
$DBTable = "thread";
$DBForum = "The number of the forum you want to use to post news";

/* do some story ripping... */

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$sqlquery = "SELECT * FROM $DBTable WHERE forumid = $DBForum ORDER by dateline DESC LIMIT 0,10";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

$i = 0;

if ($number < 1) {
print "<CENTER><P>There Is NO News!</CENTER>";
}
else {
while ($number > $i) {
$title = mysql_result($result,$i,"title");
$theid = mysql_result($result,$i,"threadid");

$postquery = "SELECT postid FROM post where threadid = $theid order by dateline limit 0,1";
$postres = mysql_query("$postquery");
$post = mysql_result($postres,"postid");
print "<a href=#$post><b>$title</b></a><br>";
$i++;
}
}

?>

----------

newsc.php
----------

<?
/* declare some relevant variables */

$DBhost = "your server name or ip";
$DBuser = "the user name for the server";
$DBpass = "the pass word for the server";
$DBName = " the name of the database you're useing for vbulletin";
$DBTable = "thread";
$DBForum = "The number of the forum you want to use to post news";

/* do some story ripping... */

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$sqlquery = "SELECT * FROM $DBTable WHERE forumid = $DBForum ORDER by dateline DESC LIMIT 0,10";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

$i = 0;

if ($number < 1) {
print "<CENTER><P>There Is NO News!</CENTER>";
}
else {
while ($number > $i) {
$title = mysql_result($result,$i,"title");
$theid = mysql_result($result,$i,"threadid");
$name = mysql_result($result,$i,"postusername");
$time = mysql_result($result,$i,"dateline");
$time2 = unixtojd($time);
$time3 = jdtogregorian($time2);
$storyquery = "SELECT pagetext FROM post where threadid = $theid order by dateline limit 0,1";
$storyres = mysql_query("$storyquery");
$story = mysql_result($storyres,"pagetext");

$postquery = "SELECT postid FROM post where threadid = $theid order by dateline limit 0,1";
$postres = mysql_query("$postquery");
$post = mysql_result($postres,"postid");


print "<center><font size=+1><a name=$post></a><b>$title</b></font></center> <br>$story <br><center><A href=forums/showthread.php?threadid=$theid>Comments</a> - posted
by: $name - posted on: $time3 </center><hr color=#ffcc00 noshade size=1>

";
$i++;
}
}

?>

-----------

Of course you will probably want to customize the html elements for cosmetic reasons.

let me know if you have trouble.

JonnyQuest
04-18-2001, 09:08 PM
You guys may also want to take a look at vBPortal at http://www.911pc.com. I think it does what you're looking for...

GimmeTech
04-18-2001, 09:23 PM
Imperitus,

Thank you for taking the time to do this. I will be giving this a shot real soon to see what I can do with it. I appreciate the code.

Juan
05-08-2001, 03:36 AM
Thank you very much for posting this code. I will also be trying this script.

I have a question, Is there a way to limit the number of news items displayed in the page?

Imperitus
05-08-2001, 08:11 PM
Sure thing, In fact I should have made that a configurable variable at the top., here's how you do it.

Find this line near the top:

$sqlquery = "SELECT * FROM $DBTable WHERE forumid = $DBForum ORDER by dateline DESC LIMIT 0,10";

And change the 10 to whatever number you want to limit it to.

Good luck.

Juan
05-09-2001, 01:24 AM
Hi,

I have uploade the 3 files and I get this error:

Fatal error: Call to undefined function: unixtojd() in newsc.php on line 30

The headlines display, but not the actual news.

Hooper
05-09-2001, 01:33 AM
That is what I emailed ya about. Same here. I think you mentioned your wrote for Win2000. Unix here, any fixes you could think of? after I deleted the above mentioned date and time with the next time and date variables also. It worked. Just not with that date and time code.

Thanks
Hoop :eek:

Imperitus
05-09-2001, 06:03 PM
Okay this one is a pretty easy fix.
Open up news.php and find the following lines...

$time = mysql_result($result,$i,"dateline");
$time2 = unixtojd($time);
$time3 = jdtogregorian($time2);

and replace them with...

$time = mysql_result($result,$i,"dateline");
$time3 = date("M d Y",$time);

That should do it. enjoy.

If you want information on how to format the time to show up different, look here: http://www.php.net/manual/en/function.date.php

Hooper
05-09-2001, 07:16 PM
Imperitus.

You sent me the code for posting news in a private forum and then having the comments link point to a public forum. Can you either send this to me again or post it. Forgive me I redid the machine and forgot to backup the email. :o


Thanks
Hooper

Imperitus
05-09-2001, 07:34 PM
Actualy I don't think I ever did that exactly. What I did was send you information on how to make a forum moderated so that only admins and moderators can make new threads (and thus news items that will be ripped to the news page with this script), but where anyone can reply to news posts.

Thus all the news is posted to a thread and anyone can read and reply but not start new news threads.

The selective moderation information is here:
http://www.vbulletin.com/forum/showthread.php?threadid=15904

Actual, I have made several changes and small tweeks... if you go to the site I'm working all this stuff out for: http://www.onandoffroad.com you can see what I'm doing... I have lots of stuff posting to the home page, and I'm using the user database for a user register... ( go to trucker registery ),
All of the stuff I'm doing requires no changes to the database and minimal changes to vbull, So in the event of a reinstall things should be easy to keep right.

Any comments? Just curious.
BTW it's built for IE anything else might look funky...

Hooper
05-09-2001, 07:42 PM
Wow... Nice site. Looks fantastic. :)

I guess I misunderstood what the fix was you sent. I was wanting to post in a private forum, and then have the thread create the news like it does and the comments link to a public news forum. So I guess when you make the post in the private forum, It also makes the post in the news forum for others to make the comments on. Reason? It would be real nice for administrators to have private access to the forums they post news from. Then they could go back there, add new news and not worry about someone posting a reply to that thread. Many other reasons also, that is the main one.

The Site looks superp though. I like what you are doing.

Hooper....

Imperitus
05-09-2001, 07:57 PM
I see what you're asking but I don't know that I can help with that exactly. Sorry.

To do what you want would require a custom version of the newpost.php vbull files... so far my php skills are not up to tackliing something so complex. This news script was my first php / mysql project.

Hooper
05-10-2001, 12:25 AM
Imperitus,

Well cheer up ;) I'm pretty good with html, but mysql and php are all new to me. I think it's great what you've done so far. I did get your script to work and everything. What I have mentioned above is just an Idea. I sure don't know of any hacks that will do this at all. Complicated I'm sure. Just throwing it out there. :D

Thanks for your contribution,
and your work. Oh, and thank you for the time fix.
Hooper

Imperitus
05-10-2001, 12:30 AM
No prob. BTW if you haven't seen it yet check this out...
http://vbulletin.com/forum/showthread.php?postid=103848#post103848

Hooper
05-10-2001, 12:43 AM
Ya and it looks as if you post in the wrong forum again you are going to get something whacked off.....lol :D

Imperitus
05-10-2001, 12:54 AM
Yeah well, I figure as long as I'm being nice and trying to help other people out they'll not chop my hands off, I mean how could I fix my scripts then? :)

Juan
05-10-2001, 06:25 PM
I have moved completely from Newspro to this script. It works like a dream and it's very easy to configure.

I use it HERE (http://www.christopherleeweb.com)

The site is in 4 other languages and the script can be used to pull news from different news forums in other languges.

I cannot thank you enough for this script, for me it's the ideal news program.

Imperitus
05-10-2001, 08:31 PM
Juan,

Thanks a lot. I'm glad to help.

Just so you know I am working on a more feature rich script set that will be a bit more power full, you can see my work files here:

http://www.onandoffroad.com/GVCP/

And the thread here at vbulletin is here:

http://www.vbulletin.com/forum/showthread.php?threadid=16377

Let me know if you have any specific requests for me to try and work into the new script if you're interested.

-enjoy