PDA

View Full Version : Mini Mods - [Naxon] Global Variables


Naxon
08-12-2007, 10:00 PM
Please note that this mod is in BETA stage and it isn't contains a lot of variables...
In the future (next version) I'll add more variables.

Variables List:

$naxon - User's ID.
$naxon[username] - Username.
$naxon[usergroup] - User's group ID.
$naxon[userposts] - User's post count.
$naxon[userkarma] - Users karma (reputation).
$naxon[usermail] - User's email address.
$naxon[ip] - User's IP.

## Added in version 1.1 ##

$naxon[totalforums] - Total number of forums.
$naxon[totalcats] - Total number of categories.
$naxon[totalpms] - Total number of Private Messages.
$naxon[totalthreads] - Total number of threads.
$naxon[totalposts] - Total number of posts.


This Modifictioin Is Running Queries !!

You can use those variables wherever you want !

[U]Just Upload The Product !!

Next version - more vars :)

Naxon
08-13-2007, 08:31 PM
First post reserved.

Version 1.1 Released: New Variables
Variables added in 1.1:

$naxon[totalforums] - Total number of forums.
$naxon[totalcats] - Total number of categories.
$naxon[totalpms] - Total number of Private Messages.
$naxon[totalthreads] - Total number of threads.
$naxon[totalposts] - Total number of posts.

Adrian Schneider
08-13-2007, 08:35 PM
Not to be rude, but what is the point of this?

Cole2026
08-13-2007, 08:45 PM
Not to be rude, but what is the point of this?

Yeah, doesn't the userinfo array carry all this information?

ragtek
08-13-2007, 08:47 PM
all this variables existists without your plugin ;)
so it is just extracode that have to be executed and extramemory because you are not using & ( don't know whats the exact name on english)

Naxon
08-13-2007, 08:53 PM
^ I know, I'm doing now a new version with new variables.

ragtek
08-13-2007, 08:54 PM
lol?

SCRIPT3R
08-13-2007, 08:57 PM
same idea; https://vborg.vbsupport.ru/showthread.php?t=133923? but again, useless as all this is already available by default.

Naxon
08-13-2007, 09:25 PM
Version 1.1 Released: New Variables
Variables added in 1.1:

$naxon[totalforums] - Total number of forums.
$naxon[totalcats] - Total number of categories.
$naxon[totalpms] - Total number of Private Messages.
$naxon[totalthreads] - Total number of threads.
$naxon[totalposts] - Total number of posts.

ragtek
08-13-2007, 09:32 PM
i would use the forumcache instead of your query for the forums, because if someone don't have the rights, he shouldn know how many forums exist in my eyes

for all other things the same..
just want to help ;)

Paul M
08-13-2007, 09:35 PM
This adds five select queries to every page, including selecting the entire post, pm and thread tables !

I suggest you need to rethink this - those queries will kill anything but the smallest forums.

Naxon
08-13-2007, 10:53 PM
^ sorry, I forgot to add this on the new version.

Wayne Luke
08-14-2007, 01:08 AM
It would be better to create a datastore row for this and then use a scheduled task to update that row. Then all the information can be pulled with one query, you don't pull extra crap out of the database and the administrator of the site can adjust the interval to suit his/her site. Just adding variables to add them isn't always a good idea.

Surviver
08-14-2007, 03:40 AM
With the following PHP-Code you can save 2 Queries.

$forums = 0;
$categories = 0;

foreach ($vbulletin->forumcache as $forum)
{
if ($forum['options'] & $vbulletin->bf_misc_forumoptions)
{
$forums++;
}
else
{
$categories++;
}
}

Zachery
08-14-2007, 04:16 AM
^ sorry, I forgot to add this on the new version.
Whats the point of duplicating these?


$naxon[userid] - User's ID.
$naxon[username] - Username.
$naxon[usergroup] - User's group ID.
$naxon[userposts] - User's post count.
$naxon[userkarma] - Users karma (reputation).
$naxon[usermail] - User's email address.
$naxon[ip] - User's IP.

Those are all already available in $bbuserinfo / $vbulletin->userinfo

FreshFroot
08-14-2007, 04:16 AM
Naxon.. your better off putting time in the SEO hack you were making than this hack...

Magnumutz
08-14-2007, 05:27 AM
I concur with FreshFroot... that re-write mod was really starting to get som attention.

Naxon
08-23-2007, 10:11 PM
Yeah, I can't find time... I'll continue this soon...
I'm working :)

Zachery
08-25-2007, 12:00 PM
^ sorry, I forgot to add this on the new version.
Whats the point of duplicating these?


$naxon[userid] - User's ID.
$naxon[username] - Username.
$naxon[usergroup] - User's group ID.
$naxon[userposts] - User's post count.
$naxon[userkarma] - Users karma (reputation).
$naxon[usermail] - User's email address.
$naxon[ip] - User's IP.

Those are all already available in $bbuserinfo / $vbulletin->userinfo

booktoweb
01-26-2008, 11:59 PM
nor work with 3.7.0

MiahBeSmokin420
01-27-2008, 12:27 AM
Delete This Post I Made | Delete This Post I Made | Delete This Post I Made |