PDA

View Full Version : Slashdot.org-style news posting system


09-01-2000, 09:06 PM
I'd like to have certain memebers of my forum, Admins, moderators and SuperModerators, be able to post news to the front page of my site, and have a 'comments' link at the bottom of the summary that links through to a new thread that was generated when the news article was posted. Then other members of the site can comment on the story from within the regular vB system.

Stallion and others talk about it in the Suggestions forum: http://www.vbulletin.com/forum/showthread.php?threadid=2746 and he says it would be a pretty easy hack to do.

One other thing about the initial news post. I'd like it to show a small mugshot of the news poster (here's mine: http://pixelpusher.com/ut/oriion.gif ) much like the ones used at http://www.highervoltage.net.

Also, since my forum is based on individual games, it would be cool if the news thread was created in the corresponding forum. Quake news goes to the Quake forum and such. Plus, a special icon, color or title should distinguish the news thread from the regular threads in the destination forum.

What do you think?

-Nathan

09-01-2000, 10:23 PM
I've been looking for something similar. I could probably handle the basic coding myself...however I would need someone to point me to some of the SELECT/INSERT statements and echo commands...

09-01-2000, 10:26 PM
slashdot provides all of the source to the news system at their site, although it looks like a beast of a task to set the bugger up. Anyway, just thought I'd mention that the source is readily available.

09-01-2000, 10:32 PM
Yup, found at http://www.SlashCode.com - all well and good, but I think it's in Perl/SQL, rather than PHP.

I think a hack for vBulletin would be much easier.

All I really want is to be able to let users login and post comments normally...I can add the news stories with my own PHP script and all...just need to know what commands I can put to allow for SlashDot-style comments after the story/review/article. :D

09-02-2000, 12:05 AM
Check out phpSlash at:
http://phplib.netuse.de/

Its PHP/mySQL based. I don't personally have it installed on my site (I tried - I'm dumb when it comes to creating tables.... esp. without telnet)....

But I saw it on someone else's.... can't remember who's....

It look cool though...
Might be easier to integrate with vbulletin than regular Slash...

Check it out...

rockergrrl

09-02-2000, 12:10 AM
Originally posted by rockergrrl
Check out phpSlash at:
http://phplib.netuse.de/

Its PHP/mySQL based. I don't personally have it installed on my site (I tried - I'm dumb when it comes to creating tables.... esp. without telnet)....

But I saw it on someone else's.... can't remember who's....

It look cool though...
Might be easier to integrate with vbulletin than regular Slash...

Check it out...

rockergrrl i believe phpslash is used intergrated into the highvoltage.net site ?

09-02-2000, 01:06 AM
I am implementing a Frontpage Weblog (News)feature on my site http://oldamigos.com I tried alot of the Slashdot type and gave up, I got the hack from this forum, If interrested I'll look it up again. Since it's vB hacked up, it's easy to make changes.

09-02-2000, 01:07 AM
yes, but highervoltage is not a smooth integration. You have to click through twice to actually join the discussion.

[Edited by Nathan on 09-01-2000 at 10:13 PM]

09-02-2000, 01:24 AM
there was a hack for this before, but I could never get it, the URL was down or something, I don't remember, and when I replied to its topic I never got a response

09-02-2000, 01:59 AM
I have put Paul Youngs Weblog Hack at ftp://ftp.oldamigos.com/pub/bfc_ws.zip for you if you want it. I'll leave it there for a couple days if anyone wants it.

09-02-2000, 03:09 AM
thanks, DLed

09-02-2000, 05:18 AM
i have several pages set up with several cgi scripts already, converting them over to php pages would be a major pain, don't supose there's a simple cgi script that will read a particular forum and i could code the rest out to look and act like slashdot is there?

09-02-2000, 06:54 AM
arg.. the weblog hack zip seems to be corrupted :( I've downloaded it several times and its corrupted every time...

09-02-2000, 02:11 PM
Me 2. Corrupted zip.

09-02-2000, 02:31 PM
Yup, same here. :(

Can someone point me to the vBulletin code that's used to verify a person's username and pasword, and perhaps the code for the form as well? With these I should probably be able to handle adding the ability for little SlashDot-style comments on my own. :)

09-02-2000, 02:46 PM
Originally posted by TWTCommish
Can someone point me to the vBulletin code that's used to verify a person's username and pasword, and perhaps the code for the form as well?require("global.php"); and then call the verifyusername function:

$userid=verifyusername($username,$password);

09-02-2000, 02:53 PM
Isn't there more to it than that? I thought there was something like a SELECT command to pull the username/password from the DB.

09-02-2000, 03:45 PM
It's all done in that function - you have to use a require on global.php to use it though.

09-02-2000, 03:46 PM
same here.... can you re-up it?

Much appreciated!

09-02-2000, 06:51 PM
is there a cgi version of this? or is there an easy way to exec cgi scripts in a php document?

09-02-2000, 07:02 PM
You'd do better to learn a little PHP - it's similar to Perl anyway.

09-03-2000, 07:20 AM
I heard that some of ya'll were having problems locating the BFC weblog that I wrote a month or two ago...sorry about the problems, I had to go offline after I lost my hosting provider and have just now been able to get back on. I have put the "official" BFC weblog zip back onto my site, but I can't find the instructions page I had on the site so you will have to make do with what is in the zip. It's all the same thing anyway. I actually posted it to a thread awhile ago, I'll see if I can dig that up... There is a readme in the zip that goes into egregious detail about the whole install. Here is the link:

http://www.eternityproductions.com/downloadable/bfc_ws.zip

The BFC Weblog System provides the following:


A slashdot-like interface
simple* integration into your already exisiting vB
easily meshes with other PHP pages (ie, you can add it to your homepage quickly with the addition of one line of code)
highly extensible output in bfc.php


I get good use out of it and maybe you can too. It's also released under the GPL to you can play with it :) (only my code, not the vB libs).

if there are requests I'll provide support or more info in this thread.

-- Paul

09-03-2000, 01:40 PM
Hey, cool - thanks man!

Just DL'd it and will give it a go a little later...I guess I'll post the results here. :)

09-03-2000, 02:46 PM
Dagnabbit! Still corrupted. :(

09-03-2000, 09:53 PM
I'm using Pauls script on my site at http://oldamigos.com I've made a few changes, I have hid the news forum from view in the main forum so you just see the news on the front page, but that's controllable with vBulletin as to however you want to implement it. I also added a Introduction field, the only field that shows on the frontpage, the readmore takes you to the thread and main text. This keeps the front page text to a minimum, I set it to 250 char. as it's done with Slashdot.

The only thing I'm lacking now is members, I have hesitated seeking out members until I got it all up and running. Then I had to change Hosts. I was using Cihost and got tired of the lack of service. My email was down for over a week and my service ticket request wasn't even assigned to a tech. yet.

So who wants to be the first member, how about helping out a fellow vB'er get started. At least let me know what you think about my site design and check out Pauls hack. I grabbed a few of the new icons from here. But I'm color blind and only see blue and bright colors. So Blue it stays for now.

Sorry for rambling off into a topic that should be in another forum... So YELL at me if you must.

09-04-2000, 09:49 PM
Paul, i was wondering if you might want to add these extra feautres I need for my site to your code. There are only a few:

1. The ability for the news thread to be posted to any forum, instead of a designated news forum (Quake News would be added to the Quake forum). Plus, a special icon, color or title should distinguish the news thread from the regular threads in the destination forum.

2. automaticly insert the author's logo into the news post.

3. would it be possible to track how many news stories a member has posted?

4. Would it be possible to list the 5 previous stories in a box on the side of the front page?

If Paul's not interested, does anyone else want to help me by adding to his hack? Is anyone else working on a system like this?

BTW, this is for a new gaming community site at http://www.tournament.com (nothing there right now, check in a few days).

09-05-2000, 05:47 PM
Just installed the BFC weblog and it went in quite smoothly.

I did hack in a summary field like wajones did so I can have a short intro on the front page, then the main story in the forum.

The only two suggestions I would make is to put the above summary field into it, and to use something besides the prinf() for the output of the article listings.

I changed it to echo statements and it made it much easier to move things around to where I wanted them, without having to worry about the order in the comma list below.

Anyway just my .02 but a great script... THANKS!!

09-06-2000, 04:33 AM
I had toyed w/ the idea of limiting the front page characters in but decided to wait on it until I had a more elegant solution than just gutting the story after 255 chars or whatever... Did ya'll solve this problem so that the script can cut it at an arbitrary point or just chops it @ 255? I didn't want to lose it in mid sentence...maybe I'll have it parse for \n\n or something, but that would limit pagination in the news script...that's no good either. I'll have to think about it.

Also, to the person who had asked about the additional hacks...

1) Yes it would be *possible* to have the script search through all the threads in all the forums for specially designated news threads but IMHO it would be a bad idea, because it would be a HUGE strain on the server as opposed to how it is now, where it just grabs the first X amount of threads from X forum. I could probably advise you on how to do it, but I don't really want to. sorry.

2) Logo like a picture or an avatar? Yes that would be a very simple and easy to add hack. If there is a "standard" avatar hack for vB could someone please point me to it and I'll add the code for the BFC, otherwise it would be a unique hack for every vB according to the mySQL field you added for your avatars...

3) I think so...I'll look into it.

4) Possible, and probable! In fact, here is the code:

<?php

require("bfc.php");

$footer_sql = "SELECT * FROM thread WHERE forumid=$newsforum ORDER BY dateline DESC LIMIT $bfcnewslimit,5";

$footer_result = mysql_query($footer_sql);

while($myrow = mysql_fetch_array($footer_result))
{
$threadid = $myrow["threadid"];
$subsql = "SELECT * FROM post WHERE threadid=$threadid ORDER BY postid LIMIT 1;";
$subresult = mysql_query($subsql);
$posts = mysql_fetch_array($subresult);

printf("<a href=\"%s/showthread.php?threadid=%s\">%s</a><br><br>",$forum_url,$threadid,$myrow["title"]);
}

?>


Add that to your PHP file, I wrote it off the top of my head so if it doesn't work play w/ it or let me know...you'll obviously have to change your db settings.

Regards,
Paul

09-06-2000, 01:14 PM
AC-3

What I did (and what I THINK that wajones did) for the front page abbreviation, was to add an additional column in the post table for a summary.

Granted you have to type your info twice, but sometimes and intro might be better written a different way then just the first sentance of the story.

I did hack the create a post template to add the additional text field as well.

Hope that sheds some light on what I did.

09-10-2000, 07:12 AM
Can someone please post a full hack for this one, so I can implement the slash with VBB like the one used on http://www.disneysites.com
I really appreciate your help

09-15-2000, 06:42 PM
thought it would be worthwile to note:

you can download the BFC Weblog here (http://www.eternityproductions.com/Downloadable/bfc_ws.zip)

you can also see it in (limited) action at my site,
http://www.eternityproductions.com now that we're back online (shameless plug).

...info for the curious

[Edited by AC-3 on 11-01-2000 at 03:44 AM]

09-16-2000, 07:04 AM
that are outside of the forums directory?

i keep getting pathing errors back to the admin/config.php file (i think because i'm trying to include() the news.php file in another php file which is outside of the forums directory.)

how do you go about doing something like that?

09-22-2000, 05:59 AM
you can set the PHP include_path in your .htaccess file to put the config.php file where ever you need. Then you won't get path errors. I have done this so long I probably forgot to mention it, it's so convienient when working with inc'd files (because of the DUMB way that PHP remembers the path to inc'd files that breaks paths if you try to go to different branches in a directory tree) you'll never go back. Do a google search for it or try php.net, it's a simple process.

Paul

09-22-2000, 11:26 AM
Heads up: I programmed a user-comment system for my site (MovieForums.com)...people will be able to leave comments with their username and password FROM my copy of vBulletin...it'll also count their comment total in their profile...like the post total. :)

It's a very cool integration...

09-22-2000, 12:42 PM
using the same type of intigration with my backend. Comments made will actually add to the total post count :)

09-22-2000, 01:10 PM
Thats interesting...due to the nature of mine, however, it makes more sense to seperate them.

What site is it for?

09-23-2000, 10:39 AM
A digital art site

09-23-2000, 01:07 PM
I see...very cool. :)

10-28-2000, 09:38 PM
Can anyone re-upload the BFC Web Log?