View Full Version : For vBull 2 - Generic vBull Comunity Page
Here is an easy setup to put a lot of Vbull content onto another page. You can use it to make an easy index page with some quick modification or just to access information quickly...
I realize that there are already a lot of similar hacks out there, but I felt like sharing. :)
You can see an example of this script here:
http://www.onandoffroad.com/GVCP/
You can get the files by downing them from the posts later in this thread where I have them in an attatched zip.
( I used to have the code posted here, but it has grown enough since then as to not fit as posted code anymore. )
Thank you very much for this script, it's exactly what I have been looking for.
Since no modifications are required to Vbulletin, makes it even better.
I've installed it and have just a slight problem with the line breaks.
Look here (http://www.christopherleeweb.com/gvcp.php)
Is there a code that can be inserted to correct this.
Wayne Luke
05-09-2001, 11:24 PM
Moved to the appropriate forum. Next time please make sure it is posted correctly.
TigerLily
05-09-2001, 11:25 PM
Looks great! I can't wait to implement this on my site, I've been wanting to do something like this without having to hack vB apart. Thanks for sharing!!!
TigerLily:)
Imperitus
05-10-2001, 12:27 AM
Sorry for posting in the wrong forum, I'll do better in the future.
As for the line break issue, If you enable html code in your news forum and use <br> tags that will fix it.
I'm going to try and figure out how to automaticly parse text for line breaks and things, if I get that figured out I'll update the code for you.
Imperitus
05-10-2001, 01:19 AM
I updated the code in the main file. It now will parse vbull image and link tags as well as line breaks etc... should make things look much nicer. Let me know if you have any problems. :)
Works and looks great.
I'll do a little more customisation and move all the news from Newspro onto the forums.
Thank you again.
Imperitus
05-10-2001, 01:52 AM
Great, glad to help.
Let me know if have any problems with it.
Hooper
05-10-2001, 07:33 AM
Imp,
Questions..............
1) Do you have any idea how would I get a date to post above all the days news within the news.php?
I have this script working pretty good and getting much happier with it. I like it because I can make SSI calls out of my current shtml pages and create different forums and news.php's to catagorize what I need. If there was a way to have like some sort of command to say something like.....
Well... written in Perl looks like this.
if (!($Month_Day-11) ) { $DateExtension = 'th' }
elsif (!($Month_Day-12) ) { $DateExtension = 'th' }
elsif (!($Month_Day-13) ) { $DateExtension = 'th' }
elsif (!(($Month_Day-1) % 10)) { $DateExtension = 'st' }
elsif (!(($Month_Day-2) % 10)) { $DateExtension = 'nd' }
elsif (!(($Month_Day-3) % 10)) { $DateExtension = 'rd' }
else { $DateExtension = 'th' }
if (&isNewDate) {
This looks at the date and places the date above all the days posts within the same file and doesn't add the date above todays news unless the date has changed.
2) For some reason the formatting of the posts are not showing up as formatted. How would I go about having the same format come out as I have it in the forum posting?
3) Headline links? My current setup has an ssi call that holds a certain number of lastest article links. The links are automatically generated when a post is made. So if you post, it creates or changes 2 files, It changes the news file and the headlines file. The headline file links to the below thread. When you click on it, it takes you down the page to the post.
4) How would I add a printer version and email to a friend link to the news.php?
If I can figure these few things out, Newspro is going out the door.
Thank You
Hooper
jojo85
05-10-2001, 09:30 AM
It seems like vbportal hehe
but good job man!
Imperitus
05-10-2001, 12:51 PM
Hooper,
1)I don't know off hand, but I'll put that on my list of things to try and figure out.
2)Are you using the latest version after I updated it to include additionial formating?
3)Headline links would be easy... I could work that into an update within the next couple days...
4)Printable and email functions are beyond what I had even contemplated. but don't sound like they would be too hard. Although including features like that might start taking things beyond the simplicity I was aiming for.
So I guess I'd like to know, do people want this developed further? or don't you think things like vbportal realy fill the top end needs already? I personaly started this as an excuse to start learning php and mysql... not to try and suplant existing projects, and then figured I'd release what I had just to share...
jojo85, thanks. Yes it is sorta, a watered down vbportal wanabe. :) But it's MINE dag nab it all mine! Muhahahahaha! :)
Hooper
05-10-2001, 01:05 PM
Imperitus,
Thank You for responding.
1) Please do..... :) Important.
2) No, It was't working for me with the template you had and all. I am using the one you sent me and SSI calling the file into my shtml. I couldn't figure out how to get just the html formatting out of the code in such away that it would function with your original script. If this can be done I'm all for it.
3) I hope so, I can help you sort this out.
4) Oh, we need this too.
"So I guess I'd like to know, do people want this developed further? or don't you think things like vbportal realy fill the top end needs already? I personaly started this as an excuse to start learning php and mysql... not to try and suplant existing projects, and then figured I'd release what I had just to share... "
Answer: Heck ya. vBportal is excellent, but way overblown for what I'm trying to do. The features I am mentioning are the important ones. The date above all of "the days" posts are not even done with vbportal that I know of. And of course you should further develope. Unless of course, you would rather leave the script as is. Id'e be grateful for what you wrote already if this is the case. There isn't that much more that I see. Just a few items. Then..... I personally will be much happier than that of my overblown newspro and hacks. :D
I think you will be impressed with what I am doing with your scripts. If I get everything going, I'll give you the link.
I think this is the way to do it. I was intending on waiting for a newspro hack because of the intense NP hacking I have, but to be honest, If These few issues can be sorted out, I believe I will be much more happier with what you are doing.
I downloaded and installed vBPortal. It is an excellent hack, however, for the most part it isn't what I am looking for. It has too many bells and whistles for what I am trying to accomplish. I would have to Unhack it to get what I need. ;)
Thanks Imp,
Hooper
Imperitus
05-10-2001, 01:56 PM
Hooper,
If you get a chance please try updating your gvcp.php file with the updated one in this thread. Let me know if that helps with your formating.
I'll try tackling some of the other issues tonight or later this week.
Hooper
05-10-2001, 01:57 PM
Donka.... and I'll do.;)
Imperitus
05-10-2001, 04:11 PM
FYI this is where I'm testing changes as I go.
http://www.onandoffroad.com/GVCP/
Hooper
05-10-2001, 04:44 PM
Thank You,
Hooper
musclebomb.com
05-10-2001, 04:47 PM
i have front page in php3 and inserted
<?
error_reporting(0);
require("GVCP_Config.php");
print "
";
/* side bar */
chdir("forum/");
require("global.php");
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$namequery = "SELECT username FROM user WHERE userid = $bbuserid";
$namegrab = mysql_query($namequery);
$name = mysql_result($namegrab,"username");
if ($bbuserid != 0)
{ print "Welcome back, <a href=$path/usercp.php><b>$name</b></a>"; }
else
{ print "Welcome <b>guest</b>"; }
chdir("../");
print "<hr noshade size=1>";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$sqlquery = "SELECT username FROM user ORDER by posts desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");
$sqlquery2 = "SELECT userid FROM user ORDER by posts desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");
print "Most active user: <a href=$path/member.php?action=getinfo&userid=$id><b> $daname </b></a>";
print "<hr noshade size=1>";
$sqlquery = "SELECT username FROM user ORDER by joindate desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");
$sqlquery2 = "SELECT userid FROM user ORDER by joindate desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");
print " Newest Member: <a href=$path/member.php?action=getinfo&userid=$id><b> $daname</b></a>";
print "<hr noshade size=1>";
$sqlquery = "SELECT * FROM user";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
print " Number of users: <a href=$path/memberlist.php><b> $number </b></a>";
print "<hr noshade size=1><b>Last 10 active topics:</b><br>";
$sqlquery = "SELECT * FROM thread WHERE visible !=0 ORDER by lastpost DESC LIMIT 0,$active";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
print "<CENTER><P>There are no active topics...</CENTER>";
}
else {
while ($number > $i) {
$title = mysql_result($result,$i,"title");
$theid = mysql_result($result,$i,"threadid");
$numcheck = mysql_result($result,$i,"replycount");
$numie = ($numcheck+1);
$lastposter = mysql_result($result,$i,"lastposter");
print " <a href=$path/showthread.php?threadid=$theid>$title </a><br><font size=-2> Posts: <b> $numie </b> Last post by:<b> $lastposter</b></font><br>";
$i++;
}
}
print"<hr noshade size=1>";
$sqlquery = "SELECT threadid FROM thread WHERE forumid !=36 AND visible !=0 ORDER by replycount desc LIMIT 0,1";
$result = mysql_query($sqlquery);
$threadid = mysql_result($result,"threadid");
$titquery = "SELECT title FROM thread WHERE threadid = $threadid";
$titresult = mysql_query($titquery);
$title = mysql_result($titresult,"threadid");
$postquery = "SELECT replycount FROM thread WHERE threadid = $threadid";
$postresult = mysql_query($postquery);
$posts = mysql_result($postresult,"replycount");
$viewquery = "SELECT views FROM thread WHERE threadid = $threadid";
$viewresult = mysql_query($viewquery);
$views = mysql_result($viewresult,"views");
$posterquery = "SELECT postusername FROM thread WHERE threadid = $threadid";
$posterresult = mysql_query($posterquery);
$poster = mysql_result($posterresult,"postusername");
print "<b>Most active topic ever:</b><br>
<a href=$path/showthread.php?threadid=$threadid>$title</a><br>
<font size=-2>By: <b>$poster</b> Replies: <b>$posts</b> Views: <b>$views</b></font><br>";
/* side bar end */
print "
<b>Go to</b>
<a href=$path>forum</a><br>
";
?>
and it does not work.
help !!!!
Imperitus
05-10-2001, 04:54 PM
Try changing
chdir("forum/");
to
chdir("forums/");
:)
BTW Hooper, I have the links and the separation by days working on my test script.
Hooper
05-10-2001, 06:03 PM
Major cool.... Heading that way...
Perfect!!!!!!!!!!!!!!!!
They need to cut off at 10 or a certain amount so your tables won't scroll any further than the set value. The rest just get archived in the forums. They are working exactly right!
I don't know if it is possible to have the 10 links to the last 10 articles and yet still be able to post a larger fixed amount of articles below or not. Example: 10 links to 10 last posted articles. But the articles themselves below cut off at 35.
Possible? Lukin Good. ;)
Good Work!
Imperitus
05-10-2001, 09:10 PM
How exactly would you want a print function to work? Perhaps a link on each story that will load a seperate page that includes just that story so you don't waste paper printing the other news stories?
Hooper
05-10-2001, 09:29 PM
Hi Imp,
The printer friendly version would be like it is in the forums themselves I would think. A link to that thread in printer version format would work fine. It would print only that one article, review etc.... The email to a friend or whatever would be about the same. That would be my guess. Really, the functions in the forums for each individual thread is perfect already. About like that with the code within the *.config or the News.php's would be super.
Cheers,
Hooper....
Wow... Went to your test page. Already had the printer and email a friend done.
Imperitus
05-11-2001, 02:09 AM
Here's a zip of a new version of thisscript.
It's about 90% of where I want it. Only current grip is that after emailing a news to a friend it dumps you back at the forum, not back at the news page... But I figure that's a little thing, and not worth holding up the wheel of progress...
Hooper
05-11-2001, 02:16 AM
Appreciated. You've done alot of work today. I'm sure you'll figure out the other. Amazing going from what I posted to 90% done.
And very much appreciated. I'll let you know how it goes for me tomarrow.
Thank You,
Hooper
Hooper
05-11-2001, 02:31 AM
<edit>fixed</edit>
I get a couple of errors
Here (http://www.christopherleeweb.com/GVCP/index.php)
No rush at all, since the previous version is working.
This script rules!!
Hi,
Ignore my previous post. It seems to be something to do with me loging out to see if the register form was working.
It works as well as the previous version, only for some code printed at the bottom of the page.
Imperitus
05-11-2001, 12:43 PM
Juan,
I see the errors... I'll see if I can fix that.
Imperitus
05-11-2001, 12:51 PM
BTW for future reference would people prefure I combine as many sub scripts into one file as possible or leave things in smaller easier to descifer little peices?
I see the smaller multiple files as easier to work with, and scan through if I want to make tweeks, but it does make more clutter un the server... what do you guys think?
Imperitus
05-11-2001, 02:07 PM
Here Juan, try these files... You shouldn't have to update the config...
Hooper
05-11-2001, 11:02 PM
Originally posted by Imperitus
BTW for future reference would people prefure I combine as many sub scripts into one file as possible or leave things in smaller easier to descifer little peices?
I see the smaller multiple files as easier to work with, and scan through if I want to make tweeks, but it does make more clutter un the server... what do you guys think?
I think the way you are doing it is fine. You have to realize that this is going to get picked apart anyhow. This is one of those...what should we say hack for hackers. Having all main, links, etc... calls just from one file most likely won't make it any easier. I think the seperate files is the best way to go. I can understand what you were thinking just by looking at the index.php.
That is just my two cents.
But of course I may think different before this is all over.
Thanks Again,
Hooper ;)
Here is the link again from the other thread on how to change the $time variables in PHP....
http://www.php.net/manual/en/function.date.php
Hooper
05-12-2001, 02:37 AM
<fixed>issue</fixed>
bokhalifa
05-12-2001, 11:28 AM
<a href="http://www.bokhalifa.org/daar/bo/gvcp/" target="_blank">http://www.bokhalifa.org/daar/bo/gvcp/</a>
errors
help my Hooper
Hooper
05-12-2001, 11:34 AM
I don't see any errors? Tell me what you are doing and I'm sure I can help.
bokhalifa
05-12-2001, 11:42 AM
:)
sory min
now werking good
Thank You,
Hooper:)
amykhar
05-12-2001, 12:17 PM
I have an extremely stupid newbie question. In the config file, you ask for the number of the forum that I intend to use for news. How do I find that number?
(See? I told you it was a stupid question)
Amy
tubedogg
05-12-2001, 12:25 PM
Go to your main forums page and mouse over the link of the forum you wish to use. Look for &forumid=XX in the URL where XX is a one or two digit number that is the forum number.
MrLister
05-12-2001, 08:07 PM
could you somebody plz fix it. i tried but i keep getting this one error in main.php ONLY when it's in index.php otherwise main.php alone works fine.
Hooper
05-12-2001, 08:12 PM
Originally posted by mrlister
could you somebody plz fix it. i tried but i keep getting this one error in main.php ONLY when it's in index.php otherwise main.php alone works fine.
This situation is simple. You are not following the instructions written with the files.
"In addition both side.php and login.php have to be in a folder that is outside but at the same level as forums.If you want to put them elsewhere you will need to adjust the following line to reflect that change.
chdir("../forums/");"
You will find this in the appropriate files at the top. You must set the coorect path for these files to work.
Take Care! ;)
amykhar
05-12-2001, 08:16 PM
Time for another stupid question :)
Will this work for boards where membership is required to read posts? I would like to give non-members a preview of what goes on inside.
Currently, I get a box that says No News, and nothing else. At this point, I am not sure if I messed up, or if this won't work for my board.
Amy
Hooper
05-12-2001, 08:34 PM
Originally posted by amykhar
Time for another stupid question :)
Will this work for boards where membership is required to read posts? I would like to give non-members a preview of what goes on inside.
Currently, I get a box that says No News, and nothing else. At this point, I am not sure if I messed up, or if this won't work for my board.
Amy
Hi Amy,
Yes, basically all this script is doing is accessing the database on call. Whether you SSI the info to another page or call it from the browser it is just accessing the vBDB. Members will need access clearance anyhow on your board to post comments, etc....
As far as required to have membership to read posts, This may be a bit of a problem and perhaps make portions of this script not so useful as the Comments on the articles, etc... I have mine set up to where you can read the posts but not post replies without membership. Sounds like you are doing fine. The no news means that you have indeed connected to the database and that there is no news items to be displayed. Remember to set up the _config file properly.
$DBForum = "100"; "you have to have this pointing to the forums you will be using to post with. I am telling my db that the forum id =100 here.
$path = "/path to forums/";
Both of these need to be set up correctly. If you are sure you have the correct forum id set up, go post and then call the file from the browser. You should see your posts.
Take Care,
Hooper
Imperitus
05-12-2001, 09:12 PM
Hey Hooper, thanks for being my tech suport while I'm offline. :)
Imperitus
05-12-2001, 09:16 PM
Oh and If you check my test site: http://www.onandoffroad.com
You'll see a latest poll addition, any interest in this? Should I get it pollished up to shend out?
Hooper
05-12-2001, 09:17 PM
Originally posted by Imperitus
Hey Hooper, thanks for being my tech suport while I'm offline. :)
Lol, Your welcome.
Hey I'm ready to show you. Need to let me know so I can de .htaccess the dir.
Heck ya I'm interested in the poll. Hope it is its own file.
BTW, You have my vote on this... Did you notice?
Hooper;)
MrLister
05-12-2001, 09:50 PM
yea i did that. i changed the dirs and this is the message i get
Warning: Failed opening 'main.php' for inclusion (include_path='') in c:\program files\apache group\apache\htdocs\gvcp\index.php on line 32
and for the side.php
Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\gvcp\index.php:20) in c:\program files\apache group\apache\htdocs\admin\functions.php on line 1243
and then below that is the normal side stuff.
Hooper
05-12-2001, 10:07 PM
Hello,
Try running the scripts individually from the browser. See if you can be the script to work individually instead of running the index and having it call the others.
MrLister
05-12-2001, 10:09 PM
it works individually
Hooper
05-12-2001, 10:18 PM
Originally posted by mrlister
it works individually
Ok, Then you have a path incorrect. This is why I asked you to check. ;) Check to make sure that the other files are set to grab the "global.php" information from your forums directory.
If they work individually, but not with the index, then most likely the index needs a path fix or as I said the index isn't pointing to the "global.php"
Keep working on it. If the individual files work, then the database is accessed and you are on the right track.;)
amykhar
05-13-2001, 12:05 AM
Oh well, it was worth a shot. When logged out, I get this gibberish.
http://epinionaddicts.com/gvcp/
(The domain may not work for everyone today - we just made a host move, and some people can't find us yet.)
logged in, it works just fine. I am not brave enough to try vbportal yet, and I think I would like to see a private board with something like this actually working before I do try.
Thanks for your help :)
Amy
MrLister
05-13-2001, 04:45 AM
ok i got the right dir right now. now instead of a error it shows absultly nothing where main.php is suppose to be
Imperitus
05-13-2001, 04:48 AM
amykhar
I'm looking at your site now... looks like main.php and links.php are working fine but side.php is messing up...
Try deleting
include('side.php');
from index.php and see if everything other than the side bar loads.
If so then most likely there is something in sidebar that might not jive with your setup.
Imperitus
05-13-2001, 04:57 AM
Also, your tables on index seem off, I don't know if that is a result of side.php erroring or what. But if you have eddited stuff try using the undedited script first, to see if it will work as is...
Imperitus
05-13-2001, 05:06 AM
Woohoo! thanks hooper... and anyone else who might have rated me.
Imperitus
05-13-2001, 05:14 AM
Here is the poll script.
Just stick it in the GVCP and call it from the index page with an include.
You'll have to rename in to something.php
Hooper
05-13-2001, 05:50 AM
Hey Imp,
<fixed></fixed>
Dockaych
05-13-2001, 03:28 PM
This may sound like a stupid question...
What is the path to the forums (for the config file)??? I've absolutely no idea. I've tried doing the home/www/user type address, and the http://whatever.whatever/forum addy. and I keep on getting unable to connect to database errors.
--dock
Imperitus
05-14-2001, 01:48 AM
the path to the forum should be http://whatever.whatever/forum
but unable to connect to database sounds like you have
$DBhost = "your server name or ip"; set wrong. check that make sure it is correctly pointing to the machine running mysql.
Hooper
05-14-2001, 10:19 PM
When you get time. Post in here for me when you could take a look at my site. I want you to see how Iv'e used your scripts.
Works Great.
Thanks
Hooper
Imperitus
05-15-2001, 03:45 PM
It looks nice. Lots of customization going on to vbull and everything else. Good work.
Some visitors have reported getting this error.
Warning: Cannot add header information - headers already sent by (output started at /home/chrislee/public_html/index.php:7) in ./admin/functions.php on line 1175
I get it too somethimes.
Any ideas?
Imperitus
05-15-2001, 04:55 PM
Does that error apear right above the welcome message where it says who you are or guest if it doesn't recognize you?
Imperitus
05-15-2001, 05:03 PM
It's a cookie issue... check to make sure the php files in your GVCP folder have
error_reporting(0);
set near the top. Expesialy side.php and index.php
If that doesn't solve it a temporaty fix would be to remove the welcome back part of the side.php. If you have to do that let me know so I can try and find a fix that keeps that functionality...
Seems not to work one way or another, the error is still present when I log out.
Imperitus
05-15-2001, 06:33 PM
here, try putting this file inside the forums directory that your vbull is in. Let me know if it runs without error. call it something like test.php
---------------
<?php
error_reporting(0);
require("global.php");
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$namequery = "SELECT username FROM user WHERE userid = $bbuserid";
$namegrab = mysql_query($namequery);
$name = mysql_result($namegrab,"username");
if ($bbuserid != 0)
{ print "Welcome back, <b>$name</b>"; }
else
{ print "Welcome <b>guest</b>"; }
?>
---------------
If it works the solution should be fairly easy but will require a seperate file... I'll get on that as soon as you can tell me if it functions.
the test file is located at:
Here (http://www.christopherleeweb.com/forums/test.php)
I doesn't report any errors
Hooper
05-15-2001, 07:56 PM
I was thinking of going ahead with incorporating the login to my main page. Now that you have seen what direction I am taking with this I was hoping you could help me with incorporating the login. Would I go ahead and set up the forms for this on the index.shtml? I also noticed the login.php has a few variables that would have to be changed I'm sure. Maybe,
gettemplate
if ($url!="" and $url!="index.php" and $url!=$HTTP_REFERER) {
eval("standardredirect(\"".gettemplate("redirect_login")."\",\"../gtnews/\");");
Not sure exactly what I need to do to get the login to the front page. Help appreciated.
Thanks
Hooper
Imperitus
05-15-2001, 09:09 PM
Juan,
Is that the php file I just posted? the error I see when hitting that url is:
Unable to access the News
which is nowhere in that script...
Hooper,
Are you looking for a login like I had in side.php or something different? ( the login stuff is the most problematic of the stuff I've done thus as you can see from Juan's problems. )
Hooper
05-15-2001, 09:18 PM
Hi Imp,
Ya basically what you already have, just on the front page of my site. I can deal with getting the looks and everything. I didn't realize that this was the most problematic. If this is going to take to much for you to check into for a site integration like mine, (completely off the keep it simple plan), I understand. I was hoping to somehow SSI the login into the index.shtml as I have with the other portions of the script. I saw how you did the .html within the side.php, I was thinking in terms of taking the code from the side.php for loggin out and just have it called into the index. Don't know if this makes sense, but doing the same thing I have done with the other parts of the script with just the loggin code. :confused:
Dunno.
Thanks Imperitus,
Thank you for looking into it. The front page is:
Here (http://christopherleeweb.com)
That file, I've added to the forums main directory.
Hooper
05-16-2001, 01:23 AM
Scrap what I wrote above. That would be nice to figure out, but I found something much more important. I emailed you about it.
Donka.....;)
Imperitus
05-16-2001, 03:14 AM
Hooper, I'll reply in PM.
Juan, unfortunatly I don't think I know enough to diagnose your problem by just looking at the page and the output. If you're willing to trust me pm or email me a login pass and ip to your server and I'll try to figure it out directly... if not I can send you a side bar without the welcome section... that way at least you won't get errors.
Hooper
05-16-2001, 03:34 AM
I posted reply. I'll be in here for a bit.
Thank You.
Hi
I've solved the problem by removing side.php.
The news works so well, there wasn't any point in adding the last 10 posts.
Thank you very much for your help.
Hooper
05-16-2001, 10:01 AM
It does work well doesn't it. Imperitus does nice coding. Really helpful too. ;)
Hooper
Imperitus
05-16-2001, 12:45 PM
Juan, Sorry about that. Here is a version of the side bar without the welcome message stuff that is causing your problem. It should work and give you everything else from that part of the script.
side.php
--------
<?php
error_reporting(0);
require("GVCP_Config.php");
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$sqlquery = "SELECT username FROM user ORDER by posts desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");
$sqlquery2 = "SELECT userid FROM user ORDER by posts desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");
print "<font color=$sidetextcolor> Most active user:</font> <a href=$path/member.php?action=getinfo&userid=$id><b> $daname </b></a>";
print "<hr noshade size=1 color=$hrcolor>";
$sqlquery = "SELECT username FROM user ORDER by joindate desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");
$sqlquery2 = "SELECT userid FROM user ORDER by joindate desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");
print "<font color=$sidetextcolor> Newest Member:</font> <a href=$path/member.php?action=getinfo&userid=$id><b> $daname</b></a>";
print "<hr noshade size=1 color=$hrcolor>";
$sqlquery = "SELECT * FROM user";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
print "<font color=$sidetextcolor> Number of users:</font> <a href=$path/memberlist.php><b> $number </b></a>";
print "<hr noshade size=1 color=$hrcolor><font color=$sidetextcolor><b>Last 10 active topics:</b></font><br>";
$sqlquery = "SELECT * FROM thread WHERE visible !=0 ORDER by lastpost DESC LIMIT 0,$active";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
print "<font color=$sidetextcolor><CENTER><P>There are no active topics...</CENTER></font>";
}
else {
while ($number > $i) {
$title = mysql_result($result,$i,"title");
$theid = mysql_result($result,$i,"threadid");
$numcheck = mysql_result($result,$i,"replycount");
$numie = ($numcheck+1);
$lastposter = mysql_result($result,$i,"lastposter");
print " <a href=$path/showthread.php?threadid=$theid>$title </a><br><font size=-2 color=$sidetextcolor> Posts: <b> $numie </b> Last post by:<b> $lastposter</b></font><br>";
$i++;
}
}
print"<hr noshade size=1 color=$hrcolor>";
$sqlquery = "SELECT threadid FROM thread WHERE forumid !=36 AND visible !=0 ORDER by replycount desc LIMIT 0,1";
$result = mysql_query($sqlquery);
$threadid = mysql_result($result,"threadid");
$titquery = "SELECT title FROM thread WHERE threadid = $threadid";
$titresult = mysql_query($titquery);
$title = mysql_result($titresult,"threadid");
$postquery = "SELECT replycount FROM thread WHERE threadid = $threadid";
$postresult = mysql_query($postquery);
$posts = mysql_result($postresult,"replycount");
$viewquery = "SELECT views FROM thread WHERE threadid = $threadid";
$viewresult = mysql_query($viewquery);
$views = mysql_result($viewresult,"views");
$posterquery = "SELECT postusername FROM thread WHERE threadid = $threadid";
$posterresult = mysql_query($posterquery);
$poster = mysql_result($posterresult,"postusername");
print "<font color=$sidetextcolor><b>Most active topic ever:</b></font><br>
<a href=$path/showthread.php?threadid=$threadid>$title</a><br>
<font size=-2 color=$sidetextcolor>By: <b>$poster</b> Replies: <b>$posts</b> Views: <b>$views</b></font>";
?>
Thank you very much. You are a star!
Snoop Dogg
05-17-2001, 11:24 PM
What happened to the download? :confused:
Imperitus
05-18-2001, 12:04 AM
The downloads should still work, are they not? The download counts next to them are still going up... check back a few posts till you see an attatchment in one of my posts...
Guest0321
05-18-2001, 04:25 AM
Downloads worked for me. I had to jack with a lot of stuff to get it to work, but it didn't turn out too bad. Just need to get "Most active topic ever" to work, but that shouldn't be hard.
EDITED to say: My site is now using vBulletin. Harder to install, but worth the effort.
PimpDaddy1
05-18-2001, 06:22 AM
The polls comes up empty.
how strange...
Originally posted by Imperitus
Here is the poll script.
Just stick it in the GVCP and call it from the index page with an include.
You'll have to rename in to something.php
Hooper
05-22-2001, 03:21 PM
Hello Imp? Is your brain refreshed? :D
Imperitus
05-22-2001, 04:56 PM
My brain is fully refreshed. But it is also going camping in a couple days... and so will be un available for a few...
Hooper, send me an email detailing what you wanted me to work on, if I can squeeze it in before I head out I'll give it a shot.
Hooper
05-22-2001, 05:01 PM
Lol,,,
Don't be messing that head up now. ;) But ok. I'll send the details.
Update: I sent the details via email to you.
Thank You,
Hooper
sifuhall
06-08-2001, 01:17 PM
Is this still available?
If so where is the download?
Hooper
06-08-2001, 02:54 PM
Page 2 halfway down the page.
stryke
06-15-2001, 06:02 AM
Help! I'm getting this error: (side)
Warning: Cannot add header information - headers already sent by (output started at /home/mrcry11/public_html/GVCP/index.php:20) in /home/mrcry11/public_html/forums/admin/functions.php on line 1183
Warning: Supplied argument is not a valid MySQL result resource in /home/mrcry11/public_html/GVCP/side.php on line 14
Warning: Supplied argument is not a valid MySQL result resource in /home/mrcry11/public_html/GVCP/side.php on line 17
Welcome guest
Please Register.
cyrus
06-15-2001, 06:46 AM
hmm
this looks like a baby version of vbportal. I think Id go for vbportal. I know theres more hassle installing it but Id rather spend the effort to get THAT on my site as it has more functions.
Although I DID try installing this hack and it didnt work for me . Said in a small box " Cannot read news"
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.