PDA

View Full Version : vBFavorites v1.0


Mystis
30 Dec 2002, 06:51
Alright everyone, here's my first (hopefully of many) released hack, so have mercy :)

This hack adds a category to your index.php page containing the X (customizable) most frequented forums by that particular user. This hack does not apply to guests however, or members who have no (or less than a customizable amount of) posts.

Not much more to it, it's a very simple 2 minute install and it should (although I haven't verified it) work across 2.2.x. A live demo will be available soon at Somethingleet (http://www.somethingleet.com), but for now some screenshots will have to do. Please let me know the url of the forums you install it on, if you do, I like seeing where my work is used :)

Screenshots:
Screenshot of what it looks like to your qualifying user with a sufficient number of posts - [here (http://www.vbulletin.org/forum/attachment.php?s=&postid=336081)]
Screenshot of how it appears to a guest - [here (http://www.vbulletin.org/forum/attachment.php?s=&postid=336082)]
Screenshot of how it appears to a registered user without a sufficient number of posts - [here (http://www.vbulletin.org/forum/attachment.php?s=&postid=336084)]

Minihacks & Customizations:
Exclude a forum from favorites (http://www.vbulletin.org/forum/showthread.php?s=&postid=336488#post336488)
Make 'Your Favorites' Username's favorites (http://www.vbulletin.org/forum/showthread.php?s=&postid=336499#post336499)

If you like the hack, make sure and install it (http://www.vbulletin.org/forum/misc.php?s=&action=install&threadid=47124)!

Mystis
30 Dec 2002, 06:54
Screenshot of what it looks like to your qualifying user with a sufficient number of posts

Mystis
30 Dec 2002, 06:54
Screenshot of how it appears to a guest

Mystis
30 Dec 2002, 06:54
Screenshot of how it appears to a registered user without a sufficient number of posts

Auero
30 Dec 2002, 07:29
nice one Mystis :)

LangTuDaTinh
30 Dec 2002, 09:28
how do u calculate which forums to display in favorite?

Chris M
30 Dec 2002, 09:49
Looks good:)

Satan

NuclioN
30 Dec 2002, 10:07
"most frequented forums by that particular user" ??? It looks as they are displayed random, not in any relation to the postingbehavior of a member.

One-Team
30 Dec 2002, 11:58
very cool hack i like it :cheeky:

Mystis
30 Dec 2002, 15:51
Originally posted by NuclioN
"most frequented forums by that particular user" ??? It looks as they are displayed random, not in any relation to the postingbehavior of a member.

No, they display the forums that the user posted most in. In the first screenshot the user posted 6 times in the main forum, 6 times in the secondary forum, and twice in the third-ary and fourth-ary forums. Third-ary is displayed over fouth-ary because it has a higher posting order.

Originally posted by LangTuDaTinh
how do u calculate which forums to display in favorite?

A single SQL query, which you can find in line 33 of the installation text file :) It takes the 3 (or whatever number you specify) forums in which the user has made the most posts,

Crazy Pete
30 Dec 2002, 16:27
Looks good!

/me clicks install

mx3
30 Dec 2002, 18:29
Wow! This is great!

*installs*

P.S. i installed on a 2.2.6, so it should work from (at least) that and up.

Chris M
30 Dec 2002, 18:32
In theory it should work for all vB 2.2.x versions;)

Satan

Okiewan
30 Dec 2002, 21:46
VERY USEFUL!!
Congrats on a great idea.

Anyway to include the member name in the "Favorites" line?
ie; "MemberName's Favorites"

Mystis
30 Dec 2002, 22:29
Originally posted by Okiewan
VERY USEFUL!!
Congrats on a great idea.

Anyway to include the member name in the "Favorites" line?
ie; "MemberName's Favorites"

Hmm...since this is a standard forum/category, you would have to do some heavy template editing, which probably isn't worth the effort. If it's in real high demand then I might figure out how though, it's not something that I can do off the top of my head.

Velocd
30 Dec 2002, 23:24
If I'm understanding correctly, this hack shows your most frequently posted forums in the "favorite list", correct? Well, if this is the case, and Okiewan wants it simply to show the members name, then use $bbuserinfo[username] in the "favorites" line, that will show the members name. Unless I am missing something.. ;)

Chris M
31 Dec 2002, 00:02
Of course you aren't Velo;)

I was just about to say the same thing;)

Satan

Icheb
31 Dec 2002, 00:14
Uhm, "third-ary"? ;c))) ;)

Mystis
31 Dec 2002, 00:48
Originally posted by Velocd
If I'm understanding correctly, this hack shows your most frequently posted forums in the "favorite list", correct? Well, if this is the case, and Okiewan wants it simply to show the members name, then use $bbuserinfo[username] in the "favorites" line, that will show the members name. Unless I am missing something.. ;)

You aren't able to add variables to things such as forum names, are you? I was pretty sure that you aren't able to. Let me go test it out.

Edit: Nope, didn't think it would. I tried making a replacement turning {username} to $bbuserinfo[username], and that didn't work either.

LangTuDaTinh
31 Dec 2002, 05:18
great hack....i installed it...thanks

is there a way i can exclude a forum from fav. forums? (which will effect to all)

Mystis
31 Dec 2002, 05:31
Sure, just change

$query = $DB_site->query("SELECT forum.forumid as forumid, forum.* as foruminfo, COUNT(post.postid) as numposts FROM forum, thread, post WHERE forum.forumid=thread.forumid AND thread.threadid=post.threadid AND post.userid='".$bbuserinfo[userid]."' GROUP BY forumid ORDER BY numposts DESC LIMIT 0,".$max_forums);

to

$query = $DB_site->query("SELECT forum.forumid as forumid, forum.* as foruminfo, COUNT(post.postid) as numposts FROM forum, thread, post WHERE forum.forumid=thread.forumid AND thread.threadid=post.threadid AND post.userid='".$bbuserinfo[userid]."' AND forum.forumid!=9999 GROUP BY forumid ORDER BY numposts DESC LIMIT 0,".$max_forums);

Replace 9999 with the forumid of the forum you want excluded.

Velocd
31 Dec 2002, 06:29
lol, I had forgot that forum names were even inputted.. I must have been thinking it was hardcoded for some reason (been a while since I added a forum). :p

Anyway, to get the effect you requested Okiewan, find in index.php:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

And above it place:

if($forum[forumid] == $favorites_id && $bbuserinfo[userid] <> 0){
$forum[title] = "$bbuserinfo[username]s’ " . $forum[title];
}


;)

Mystis
31 Dec 2002, 21:45
Nice velo, I was looking at it like it was much more complicated than that. I think I'm going to index all of the little code modifications on the first post.

Silenced Soul
31 Dec 2002, 22:36
nice hack. Got no use for it, on my site though...

Darth Cow
31 Dec 2002, 23:56
Awesome hack. I installed it last night in less than 5 minutes and my members have already made several dozen posts on the thread I made for feedback praising it :).

Mystis
01 Jan 2003, 01:38
That's great to hear DC :D That's on my agenda for v2, also, is making an editable list.

Freestyler
01 Jan 2003, 04:27
Is it possible to modify this hack so that you can have (in the style header), just below the main forum logo/buttons, little text links of just the three 'favorite' forums?

So that no matter where the user is in the forums (well, wherever the header is displayed), they can always just hit one of the three links to go to one of their top 3 forums?

If that's not possible, then is there any other hack which can do this :) ?

Mystis
01 Jan 2003, 05:01
Sure, it would take some heavy modification, but the SQL query is there, and that's what took me the bulk of the time developing this hack. I'll give it a shot and see what I can do :)

supreemball
02 Jan 2003, 01:56
sweeeeeet mystis.

SL will definitely enjoy this hack :D

Mithan
02 Jan 2003, 02:31
Great hack, but it would be cool if you could somehow modify this hack so that people could specifically add forums to the favorite list.

Mystis
02 Jan 2003, 04:08
Mithan - that would be a complete overhaul, but I am planning to do this in version 2.

Supreem - That's great, I'm glad to be able to use it :D It was a fantastic idea.

Mithan
14 Jan 2003, 15:25
Ok awesome.

One thing I thought you should know as well, is that if you have the collapsable thread install, when you collapse the "favorites", the original forum section collapses as well, and vice versa.

Mystis
15 Jan 2003, 03:13
Originally posted by Mithan
Ok awesome.

One thing I thought you should know as well, is that if you have the collapsable thread install, when you collapse the "favorites", the original forum section collapses as well, and vice versa.

Yeah, the way this is set up there would be compatability problems with many forumhome hacks. Not really a catch-all way to fix any of the problems, it would have to be done on a per-hack basis and I don't have the time to do that, sorry.

ddausch
05 Feb 2003, 15:07
Hallo

da ich kein english kann versuch ich meine Frage halt auf deutsch zu stellen und hoffe das jemand antworten kann :D

Habe den hack wie beschrieben eingebaut... nur wie können die User nun Ihr Favoriten in das Board eintragen ??

ddausch
05 Feb 2003, 19:25
Hab dann hinbekommen... nur das diese funktion arg zu lasten der boardgeschwindigkeit geht

Mystis
05 Feb 2003, 22:56
Originally posted by ddausch
Hallo

da ich kein english kann versuch ich meine Frage halt auf deutsch zu stellen und hoffe das jemand antworten kann :D

Habe den hack wie beschrieben eingebaut... nur wie können die User nun Ihr Favoriten in das Board eintragen ??

Noch nicht aber arbeite ich daran in meiner freien Zeit:) soll Es bald beendet werden.

- Freetranslation.com :D