The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#12
|
|||
|
|||
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, |
#13
|
|||
|
|||
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? |
#14
|
|||
|
|||
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 |
#15
|
|||
|
|||
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. |
#16
|
|||
|
|||
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...
|
#17
|
|||
|
|||
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. |
#18
|
|||
|
|||
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? |
#19
|
|||
|
|||
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. |
#20
|
|||
|
|||
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. |
#21
|
||||
|
||||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|