PDA

View Full Version : My Favorite Forum HACK!


06-10-2000, 04:39 PM
This hack lets users select the forums that they want to read.Please feel free to use this hack,and help me find some unknown bugs.Thanks!

http://home.keyciti.com/Godfather/myfavorite.zip

06-10-2000, 07:35 PM
ah, I saw this hack for the UBB a while ago :)
Nice to see it ported to vB

06-11-2000, 07:13 AM
Can we see a demo of this hack in action?

Parker

07-16-2000, 04:20 AM
Damned thing works! Pretty nicely, too.

I think there's no demo up from the author because his site and message boards are in Chinese.

[Edited by Dave Baker on 09-05-2000 at 09:39 PM]

07-16-2000, 04:47 AM
hrmm I missed this hack. It seems nice but you force certain forums to always be shown?

07-16-2000, 09:22 AM
cool anothe hack... i haven't installed it but need to ask, how do you undo a site from your favourites ?

07-16-2000, 09:43 PM
The idea is that a registered user only sees those forums that have been marked as favorites (once the registered user has gone through a screen http://yourdomain.com/favorite.php3 to put a check next to his or her favorites), which is nice for a 60+ forum site like mine.

The preferences can be reset by going through that page again (though the registered user must be logged in), and unchecking or checking different checkboxes.

I modified Godfather's forumselection template to be more clear about the need to be registered in order to use the feature:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD><TITLE>Specify Favorite Message Boards</title>
$cssinclude
</head>
<body>
$header
<form name="form1" action="favorite.php3" method="POST">
<input type="hidden" name="action" value="complete">
<table border="0" width="95%"><tr>
<td valign="top" align="left"><a href="index.php3"><img src="$titleimage" border="0"></a></td>

<table cellpadding="0" border="0" width="100%"><TR>
<td valign="top" align="left">
<smallfont>$logincode</smallfont>
</td>
</tr></table>
<hr>
<table border="0" width="100%" cellpadding="2">
<tr><td width="100%" valign="bottom">
<normalfont><b>Instructions:</b> Use this page if would like to see only your "favorite" message boards each time you visit the home page for $bbtitle.<OL><LI>This feature requires you to be a registered user.
<LI>Registered users, please log in now if you see boxes above asking for your username and password.<LI>Check one or more boxes below to select your favorite message boards.<LI>Then click the "Register Favorites" button at the bottom of this page.<LI>$bbtitle thereafter will display only your favorite message boards when you visit the home page, if you are logged in at that time (i.e., this feature won't work if you visit $bbtitle as a guest from another computer, if you have told $bbtitle to quit tracking your visits, or you have disabled the use of cookies on your Web browser).<LI>To change your favorites, just visit this page again. </OL></normalfont>
</td></tr></table>

<!-- jel -->
<table width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0"><tr>
<td width="100% bgcolor="#000000">
<!-- /jel -->

<table cellpadding=4 cellspacing=1 border=0 width="100%">
<tr bgcolor="#113274">
<TD>&nbsp;</TD>
<td valign=bottom>
<smallfont COLOR="#FFFFFF"><B>Forum</B></smallfont>
</td>
<td NOWRAP valign=bottom align=center>
<b><smallfont COLOR="#FFFFFF">Posts</smallfont></B>
</td>
<td NOWRAP valign=bottom align=center>
<b><smallfont COLOR="#FFFFFF">Topics</smallfont></B>
</td>
<td NOWRAP valign=bottom align=center>
<smallfont COLOR="#FFFFFF"><B>Last Post</B></smallfont>
</td>
<td valign=bottom align=center>
<smallfont COLOR="#FFFFFF"><B>Moderators</B></smallfont>
</td></tr>
$forumbits
</tr></tr></table>

<!-- jel -->
</td></tr></table>
<!-- /jel -->

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<TR><TD valign="middle" align="left">
<smallfont>All times are $timezone</normalfont></td>
<td valign="middle" align="middle">
<input type="submit" name="Submit" value="Register Favorites"></td></tr></table>

</form>
$footer

</body>
</html>

---------------------

Ideally, that whole screen would become part of the profile page, which seems to be the best place for it (rather than a standalone favorite.php3 script).

My logincode template is a bit different from the standard distribution, too -- here it is (needed in order for the "if you see boxes above asking for your username and password" to make sense):

<table border="0" cellpadding="0" cellspacing="0">
<tr><td><smallfont><b>Optional log-in</b> if you have <a href="http://benefitsboards.net/member.php3?action=signup">registered (free)</a>:<br>(provides the option of viewing messages that are new since your last visit, and the option of viewing only "favorite" message boards)</smallfont></td></tr>
<tr>
<td nowrap align="LEFT"><form action="index.php3" method="post">

<table><tr><td><smallfont>Username:</td><td><INPUT TYPE="TEXT" NAME="username" SIZE="15" MAXLENGTH="25"> </smallfont></td></tr>
<tr><td>Password:</td><td><smallfont><INPUT TYPE="PASSWORD" NAME="password" SIZE="15" MAXLENGTH="13"></smallfont>
<smallfont><input type="hidden" name="action" value="login">
<input type="submit" value="Log In (Optional)"></smallfont> </TD></TR>
<TR><TD colspan="2"><A HREF="member.php3?action=lostpw">(Click here if you've forgotten your username or password)</A></TD></TR></TABLE>

</td></tr>
</form>
</table>

------------------------------

I've added this line as the first table row in my modifyprofile template (after the $parentemail
line), as a way for registered users to get to favorite.php3:

<tr bgcolor="#EFEFEF">
<td><normalfont><b><a href="favorite.php3">Click to create or change list of your favorite message boards (forums)</a></b></TD><TD><normalfont>By creating a list of favorite message boards, only your favorite message boards will be displayed each time you visit the home page; others will be hidden.</normalfont></td>
</td></tr>


[Edited by Dave Baker on 09-05-2000 at 09:40 PM]

07-17-2000, 06:48 AM
Did you know a hack where the users can add are thread in a forum to his favorites and then he see it over the other forums or by site who ever come back to the forum?

Fine Day.
Thanks for the help and sorry for my bad english.

07-18-2000, 02:48 AM
Dave:

The instructions ask you to add a column using phpMyAdmin. Did you use this program to do this? How did you go about adding a new column in the user group?

Thanks,
Parker

[Edited by Parker Clack on 07-17-2000 at 11:49 PM]

07-18-2000, 03:00 AM
Sure did. phpMyAdmin 2.0.5 was wickedly easy to use (got it at http://phpwizard.net/projects/phpMyAdmin/index.html ), even for a php/mySQL newbie like me. I clicked on "add field" after I'd gotten to the "user" table for my vBulletin database, and did what Godfather's readme.txt said to do re the parameters of the new field (called selforum). There was one ambiguity; he specifies that "null" should be set to "yes"; I clicked the "null" option from the "null" and "not null" options presented to me by phpMyAdmin for the new field's "Null" parameter.

[Edited by Dave Baker on 07-18-2000 at 12:09 AM]

07-18-2000, 04:34 AM
Thanks for the help.

Parker

07-18-2000, 03:08 PM
Very clever stuff - how did you come up with such a good idea? ;)

Just a thought :)

07-18-2000, 03:13 PM
LOL - a little birdie gave him the idea ;)

07-18-2000, 03:18 PM
Really? Who was that? Ho hum.

Just a thought :)

07-18-2000, 03:51 PM
So Ed when are you going to do this favorite forums hack? I like what is there but it needs more functionality like being able to go back to the setup page and see those areas that you already have checked and either add to or delete them.

See if you can give it the ol' Ed Sullivan touch.

Parker

07-18-2000, 04:32 PM
cal - didn't you know there's a recently discovered bird called the "Red-Breasted cal". I hear that's what told him :D

Parker - I dunno IF I'll even do it. I'm working on an attachment hack now and making my article script release quality.

07-18-2000, 04:37 PM
Originally posted by Ed Sullivan
cal - didn't you know there's a recently discovered bird called the "Red-Breasted cal". I hear that's what told him :D

You two ;)

07-18-2000, 06:35 PM
Originally posted by Parker Clack
So Ed when are you going to do this favorite forums hack? I like what is there but it needs more functionality like being able to go back to the setup page and see those areas that you already have checked and either add to or delete them.

See if you can give it the ol' Ed Sullivan touch.

Parker

When I looked at the demo Dave had up, it remembered what I had checked when I went back to favorites and I could select more or unselect what I had already. I registered on his board to test it out and it seems to do what it is supposed to.

07-19-2000, 09:47 AM
Dave:

I am not sure what he means in Step 6.

// Step 6.
// find another line to complete "if" syntax between following two line

} // if can view
} // while forums

// insert

} // if favorite

I am not sure what to put where in this statement. I am getting a parsing error at line 237 which is the line that } // if can view starts. I tried putting a } between
the if can view and while forums lines but still get the parsing error.

How did you get this to work on your board?

Parker

[Edited by Parker Clack on 07-19-2000 at 06:49 AM]

07-19-2000, 12:46 PM
The instructions aren't as clear as they could be. You put the "} // if favorites" in the right place. Did you put the "if ($favoriteonly == 0 ..." stuff in the right place? (Note the "ABOVE" instructions, in the snippet below.)

// #######################
// Step 5.
// Find in index.php
if ($getperms[canview]==1) {
// then add following codes ABOVE it (NOTE:ABOVE!!)

// ===Start of My favorite code===
if( $favoriteonly == 0 || ($favoriteonly==1 &&
$selarray[$forum[forumid]]=="T") ) {
// ===End of My favorite code===

07-19-2000, 04:45 PM
If you are interested, we are up with this functionality as well.

07-19-2000, 05:18 PM
I like the "My BigSoccer" idea as part of the top part of the page!

I wonder if "View All Boards" is the best wording for your other link, though; wouldn't setting My BigSoccer cause only the user's favorite boards to be displayed when he or she clicks on View All Boards? I sorta expected View All Boards to override the user-specified favorites when I clicked on it (or does it, and I just didn't realize that -- I didn't register).

[Edited by Dave Baker on 07-20-2000 at 12:03 AM]

07-19-2000, 06:06 PM
View all boards does override. look carefully...index.php vs. myindex.php

07-19-2000, 06:39 PM
Kewl! Tell me more! (How to get favorite.php settings to work for myindex.php but not index.php)

07-19-2000, 09:26 PM
Huss:

Could you document what you did on your board?

I have finally got the thing running without a parsing error but when I select the forums I want to see and then return to the main page it pulls up the main page as usual.
I go back to the favorite page and all the ones that I have checked off are still checked off but nothing happens to the index.php file that I see so I still see all the topic areas.

Any ideas? I have followed the code as written.

Parker

07-19-2000, 09:40 PM
Hmm. We just followed the instructins and had no problem.

07-20-2000, 02:55 AM
Now I see -- don't make any changes to index.php, but instead make the changes (described by Godfather) to a copy of that file called myindex.php

Then in myindex.php change this line

eval("echo dovars(\"".gettemplate("forumhome")."\");");

to read

eval("echo dovars(\"".gettemplate("forumhome_favorites")."\");");

Create a new template called forumhome_favorites, which is a copy of forumhome except that the links under the main graphic are different.

In my forumhome template (used for the "View All Boards" view, which the user gets by connecting to index.php), the links are coded like this:

<smallfont>Now Viewing All Boards | <a href="myindex.php3">My BenefitsBoards</a></smallfont>

But in my forumhome_favorites template (used for the "My BenefitsBoards" view, which the user gets by connecting to myindex.php), the links are coded like this:

<smallfont><a href="index.php3">View All Boards</a> | Now Viewing My BenefitsBoards | <a href="favorite.php3">Change My BenefitsBoards</a></smallfont>

Demo at http://BenefitsBoards.net

07-20-2000, 07:36 PM
Dave:

Ok, I have followed the instructions with no problems. I even used the myindex.php layout as you described and it all works great except nothing gets saved. I go to myindex.php and all the forum topics are listed. I go back to the favorite.php page and the topics that I selected are still checked but nothing is getting transferred over to the new myindex.php page.

Any ideas?

Parker

07-20-2000, 07:53 PM
You're sure the changes described by Godfather have been made to the myindex.php file?

In the myindex.php file, you've changed

eval("echo dovars(\"".gettemplate("forumhome")."\");");

to read

eval("echo dovars(\"".gettemplate("forumhome_favorites")."\");");

?

07-20-2000, 08:26 PM
Dave:

It boiled down to removing some spaces that I had in the code for index.php. It is working now.

The only problem that I have with myindex.php is that after someone posts something and they want to return to their favorites they can't just click on any of the hyperlinks back to the main page because it will take them back to index.php instead of myindex.php. That would require that you have separate forumdisplay.php and showthread.php files and would get rather hectic in setting it up.

At any rate it is working fine now.

Thanks for all the help.

Parker

07-21-2000, 02:39 AM
this would be really great if it could be applied to individual topics.

I think it's a great hack but in its present form I couldn't use it. I have enough trouble trying to get people to post in the lesser used forums now:(

09-05-2000, 03:40 PM
Just wanted to bring this one up since someone mentioned it.

09-05-2000, 05:53 PM
I was having crashes of my software fairly regularly after installing this hack -- or maybe it was due to another one -- I chickened out and backed out all my hacks. Now vBulletin is purring again. Just didn't want folks to wonder where my "favorite.php" and "myindex.php" had gone to (referenced in earlier messages).

09-28-2000, 03:47 PM
just bumping this up so I can use it :)

03-20-2001, 10:45 AM
dear Dave Baker ..
I tried to install this hack, and I had same probs as urs, plz tell me which spaces that did u mean in index.php.
if any one installed it on vb115, plz tell me.

03-20-2001, 03:07 PM
phpMyAdmin keeps screwing up for me when i do dumps. it doesn't organize it properly and later i can't put it back in unless i edit the file.

03-20-2001, 08:28 PM
Nice hack!

03-21-2001, 05:11 PM
can someone upload this file? i can't seem to connect and get http://home.keyciti.com/Godfather/myfavorite.zip . thanks in advance

03-21-2001, 10:43 PM
take it

03-27-2001, 05:14 AM
Has anyone redone the favorite.php file so it will work with 2.0 yet?

Parker

03-27-2001, 05:38 AM
Originally posted by Parker Clack
Has anyone redone the favorite.php file so it will work with 2.0 yet?

Parker

version 2.0 has this feature built-in ;)

03-27-2001, 07:55 AM
Conan:

Where in 2.0? What the favorite.php script does is allow you to select which forums that you want to see listed on the main page. And only those forums are the ones that you post in, etc. instead of all of them.

Parker

03-27-2001, 07:56 AM
Oh ok, I thought it was like the subscription feature!

03-27-2001, 08:07 AM
What would be nice is if you select threads to subscribe to it automatically opens you myVB page instead of index.php.

Parker