Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by YellowKard (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-26-2001 Last Update: Never Installs: 0
 
No support by the author.

Is there a NewsPro hack for 2.0 b3?

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-18-2001, 04:44 PM
GimmeTech
Guest
 
Posts: n/a
Default

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,
Reply With Quote
  #13  
Old 04-18-2001, 04:53 PM
Imperitus
Guest
 
Posts: n/a
Default

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?
Reply With Quote
  #14  
Old 04-18-2001, 05:12 PM
GimmeTech
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #15  
Old 04-18-2001, 08:14 PM
Imperitus
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #16  
Old 04-18-2001, 09:08 PM
JonnyQuest JonnyQuest is offline
 
Join Date: Nov 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #17  
Old 04-18-2001, 09:23 PM
GimmeTech
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #18  
Old 05-08-2001, 03:36 AM
Juan Juan is offline
 
Join Date: Nov 2001
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #19  
Old 05-08-2001, 08:11 PM
Imperitus
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #20  
Old 05-09-2001, 01:24 AM
Juan Juan is offline
 
Join Date: Nov 2001
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #21  
Old 05-09-2001, 01:33 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08007 seconds
  • Memory Usage 2,296KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete