View Full Version : Users Threads in Profile [vB3]
assassingod
01-31-2004, 10:00 PM
Users Threads in Profile
vB3 Port!
Coded by: assassingod
Extras: g-force2k2
Version: 1
Description:
This shows the threads posted by a user in their profile. You can limit
to how many threads you want to be displayed, and private forums are automatically excluded
Don't forget to click in INSTALL button if you use my hack - Thanks!:)
NTLDR
01-31-2004, 11:01 PM
Good to see you release a vB3 hack a last Steve ;)
Boofo
01-31-2004, 11:58 PM
Looks good, Steve. I'll be installing this when you get the thread permissions added. ;)
assassingod
02-01-2004, 01:19 AM
Looks good, Steve. I'll be installing this when you get the thread permissions added. ;)
Thanks.
@Boofo, just to let you know you can still exclude forums, this is just a temporary way of hiding threads until I update it;)
Boofo
02-01-2004, 01:32 AM
I saw that in your first post, Steve, but I wanted to wait until it was added to install it so I only have to do it once. That's what happens when you get old. You start looking for shortcuts to do things so you only have to do them once. Because you might forget to do them later. ;)
* Boofo walks away wondering what is was we were talking about again?
assassingod
02-01-2004, 01:38 AM
LOL! I guess that's a valid reason why not to use it yet:p
FleaBag
02-01-2004, 09:27 AM
Looks good, I'll definitely use this.
colicab-d
02-01-2004, 09:29 AM
yeah this is another one i,ll be using, but again i,ll wait till its final :D, but i,ll install now :D
assassingod
02-01-2004, 02:08 PM
Thanks all.
NuclioN
02-01-2004, 03:06 PM
Invalid SQL:
SELECT threadid,title,dateline
FROM thread
WHERE postuserid = '48' AND forumid NOT IN()
ORDER BY dateline DESC
LIMIT 5
mysql error: You have an error in your SQL syntax.
assassingod
02-01-2004, 03:14 PM
You havent defined one of the variables (The exluded forums one)
NuclioN
02-01-2004, 03:23 PM
I've defined the variables but the error remains so i've removed the line to see why the error is showing up. I use table prefix so the 'SELECT threadid,title,dateline
FROM thread'
was not working. I've added the prefix before 'thread' and now it's working. :)
assassingod
02-01-2004, 03:37 PM
Ah yes, I forgot that - thanks for reminding me.
g-force2k2
02-01-2004, 03:56 PM
// Coming Soon:
Thread Permissions (No need to manually exclude forums!)
assassingod you can use my permissions code from one of my hacks.
The function:
function get_noaccess_forumids ( )
{
global $forumcache, $bbuserinfo ;
$_naforumids = array ( ) ;
$_naforumids[] = 0 ;
foreach ( $forumcache AS $forumid => $farray ) :
if ( ! ( $farray['permissions']["$bbuserinfo[usergroupid]"] & CANVIEW ) ) :
$_naforumids[] = $forumid ;
endif ;
endforeach ;
return $_naforumids ;
}
It use the forumcache to run through user permissions so it doesn't require a query to check which users can access which forums, though it doesn't run a check on the access masks it does do the forum permissions.
Then in the member.php? im guessing add:
$forumids = implode ( "', '", get_noaccess_forumids ( ) ) ;
This takes the forums which users have no access to and sets it up for the sql statement.
Then in the WHERE section of the sql statement add:
thread.forumid NOT IN ( '$forumids' )
Cheers,
g-force2k2
assassingod
02-01-2004, 04:07 PM
Thanks very much g-force! I'll test this out right away
assassingod... does that code work properly and correctly? let us know :P
/me clicks Install to know when the new version is released
also: does this show the person's latest threads or just random threads?
MGM out
AutomatikStudio
02-02-2004, 12:05 PM
I'm getting the same database error NuclioN got.
assassingod
02-02-2004, 12:58 PM
AutomatikStudio;
Have defined the $excluded variable? and do you have a table prefix?
AutomatikStudio
02-02-2004, 01:09 PM
AutomatikStudio;
Have defined the $excluded variable? and do you have a table prefix?I ended up just putting "0" in the excluded variable and it's fine now.
assassingod
02-02-2004, 01:10 PM
I ended up just putting "0" in the excluded variable and it's fine now.
I'll add that as default.
MGM;
This shows the latest threads.
assassingod
02-02-2004, 02:38 PM
Thanks to g-force2k2, the permissions are done - thanks alot!:)
Updated to 1.1
Sadie Frost
02-14-2004, 01:20 AM
Thanks to g-force2k2, the permissions are done - thanks alot!:)
Updated to 1.1
This worked fine for me, but when I updated to 1.1 I get the error "Fatal error: Call to undefined function: get_noaccess_forumids() in /path/to/forums/member.php on line 394"
assassingod
02-14-2004, 09:11 AM
Have you done Step 2?
Sadie Frost
02-14-2004, 06:41 PM
Have you done Step 2?
Yes I did :)
assassingod
02-14-2004, 06:54 PM
Try adding above
$limit = '5'; // Enter the number of maximum threads you want to be displayed
$forumids = implode ("', '", get_noaccess_forumids()) ;
this:
require_once("./include/functions_misc.php");
Sadie Frost
02-14-2004, 07:26 PM
Looks like its working now - thanks so much! :D
assassingod
02-14-2004, 07:30 PM
Looks like its working now - thanks so much! :D
Np:)
enginethatcan't
03-15-2004, 10:18 PM
Hey bro, there are no threads showing up in profile, but the images are showing up..what's wrong
assassingod
03-16-2004, 05:29 AM
Hey;
They aren't any images in the hack, so i'm not sure what's the problem. Try re-installing it:)
well well well! I was waiting long time and now i got it ;) Good!
Any chanse to make it works ONLY with some forumsID? For example i want to show threads ONLY from one specified forum? Or even more - i want to show all threads like that hack does, AND extra ONLY from specified forum...
Thanks a lot ;)
nhochochack
03-24-2004, 10:10 AM
in the gold version , have the problem
Fatal error: Call to undefined function: get_noaccess_forumids() in d:\quang\www\vb\member.php on line 435
how to fix ?
assassingod
03-24-2004, 01:42 PM
Did you apply the file changes to includes/functions_misc.php?
nhochochack
03-25-2004, 02:27 AM
i was applyed file includes/functions_misc.php , but this problem is as
Gizmo
03-25-2004, 05:16 PM
Thanx for your work, I will translate it! ;)
assassingod
03-25-2004, 05:26 PM
i was applyed file includes/functions_misc.php , but this problem is as
Try opening member.php and find:
require('./global.php');
Under, add:
require('./includes/functions_misc.php');
nhochochack
03-26-2004, 02:25 PM
i use vbb 3.0.0 Gold version , in member.php , i only found
require_once('./global.php');
and under it i add
require('./includes/functions_misc.php'); and try add
require_once('./includes/functions_misc.php');
but it show the problem
Fatal error: Call to undefined function: get_noaccess_forumids() in d:\quang\www\vb\member.php on line 437
tnguy3n
03-27-2004, 12:53 PM
https://vborg.vbsupport.ru/showpost.php?p=476642&postcount=25
Open member.php
Find:::
$limit = '5'; // Enter the number of maximum threads you want to be displayed
$forumids = implode("', '", get_noaccess_forumids()) ;
above it, add::
require_once("./includes/functions_misc.php");
I use vb3 gold as well and dis hack works fine on my board. :)
Try adding above
$limit = '5'; // Enter the number of maximum threads you want to be displayed
$forumids = implode ("', '", get_noaccess_forumids()) ;
this:
require_once("./include/functions_misc.php");
That one given is not correct
require_once("./includes/functions_misc.php");
It's missing the "s" in includes... that's the error I got :)
Onkel_Tom
04-20-2004, 11:47 PM
// Coming Soon:
Thread Permissions (No need to manually exclude forums!)
Is this implemented now ?
I found this words still in the installation instruction of v1.1
Onkel_Tom
04-21-2004, 12:13 AM
Okay, I installed the hack and forums permissions are working ;)
another question, what must be changed to show also the latest posts ans answers of the members and not only the own started threads ?
Ah, it's not working. When i've finished following the instructions, and try to look at it, I get a fatal error for member.php on line 427, which is this one.
$limit = '5'; // Enter the number of maximum threads you want to be displayed.
Ahhhh :ninja:
assassingod
04-21-2004, 05:18 PM
Onkel_Tom; Sorry I forgot to update the install file:) As for your request, im not to sure what you mean
JaNa; I sure you you've installed it correctly? Try reinstalling it:)
Onkel_Tom
04-21-2004, 06:45 PM
As for your request, im not to sure what you mean
At the moment your hack shows only the threads which were started by this user. I also want to see his latest posts (answers) in his profile not only the threads which were started from this user.
thanks for your answer
I think I go wrong at this "Add New Phrase"
Is it the "Phrase Manager" in the Languages & Phrases Tab in AdminCp?
EDIT: Erg, I reinstalled it, following the instructions closely, and it still doesn't work :tired:
(same error)
Vivi Ornitier
04-22-2004, 07:28 PM
I get
Fatal error: Cannot redeclare get_noaccess_forumids() (previously declared in /home/squareu/public_html/forums/includes/functions_misc.php:20) in /home/squareu/public_html/forums/includes/functions_user.php on line 503
I tried applyin the require('./includes/functions_misc.php'); above the limit='5' and the require('./global.php'); and it's still not working, arrg wtf.
deaconxgp
04-23-2004, 01:35 PM
I had this hack installed when I had vB 2.3 and it somehow mapped over when I upgraded to vB 3 Gold
BUT, even though the admin CP options are there for me to designate how many threads and which threads are excluded, THEY DON'T SHOW UP.
Do I have to re-edit some files since I upgraded to 3.0??? I'm guessing that since the template mods are obviously still in tact , all I have to do is edit some .php files....but which ones do I edit in order for this to show?
Like I said, in the Admin CP I still have options for the Show Thread that somehow carried over from my Vb 2.3 hack I did. Which files do I have to re-edit for it to show up in vb 3.0?
Erg..i guess it doesn't work for my version...this is a very simple hack, and i've done it all correct!
Oh well :nervous:
Grendel
04-26-2004, 04:08 PM
Nice.
Is it possible to show the forum-title in the thread-list as well?
ludachris
04-26-2004, 07:41 PM
I'm using 3.0.1 and I can't find the line "userfield_select_option" in member.php - has this been implemented in 3.0.1?
Possible that another hack is conflicting I guess...
Onkel_Tom
04-26-2004, 08:57 PM
This hack works fine with vB3.0.1 !
The "userfield_select_option" is placed in the pre-cached templates.
Just look for the following lines at the beginning of the member.php, line 32
// pre-cache templates used by all actions
$globaltemplates = array(
'MEMBERINFO',
'memberinfo_customfields',
'memberinfo_membergroupbit',
'im_aim',
'im_icq',
'im_msn',
'im_yahoo',
'postbit_reputation',
'userfield_checkbox_option',
'userfield_select_option',
'memberinfo_usersthreads'
);
pjdaley
04-27-2004, 06:50 AM
my question is, what do you exactly edit in the code so it only shows threads started in forums indicated... like how would would i show threads with forumd ids, 1,2,3,4,5 only?
Grendel
04-27-2004, 10:55 AM
I did it this way:
WHERE postuserid = '$userinfo[userid]' AND (forumid=1 OR forumid=2 OR forumid=3 OR forumid=4 OR forumid=5) AND visible='1'
"visible='1'" because you don't want to list soft-deleted or invisible threads.
You don't need $forumids = implode ("', '", get_noaccess_forumids()) ; then. And you don't need to change includes/functions_misc.php then as well (if you have no restricted forums in the list you want to show).
I'm sure there is a better way, eg put it in $forumids, but this works too.
Now all I need is to list the forum-name too and I'm satisfied :D.
Grendel
04-30-2004, 09:59 PM
No idea about the forums?
sketch42
05-29-2004, 11:24 AM
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/sketch/public_html/vbtest/member.php on line 395
Onkel_Tom
07-01-2004, 09:37 AM
// Coming Soon:
Thread Permissions (No need to manually exclude forums!
What about this line in the installation instruction ?
any updates planed ?
long time since last post in this thread ;)
Delirion
07-02-2004, 08:48 PM
Errr.... if you check the file, it's been done already. Someone else supplied the forum permissions code and that code is Step 2 of the instructions.
Installed it, and it's working just fine :)
I got this error in 3.0.3
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/user/public_html/member.php on line 481
assassingod
07-15-2004, 08:25 PM
I got this error in 3.0.3
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/user/public_html/member.php on line 481
Did you make the edit to functions_misc.php.
If so, try looking at post #25, https://vborg.vbsupport.ru/showpost.php?p=476642&postcount=25 :) Hope that helps
oh no i didnt, but i deleted this line
$forumids = implode ("', '", get_noaccess_forumids()) ;
and it worked...
there is no special forums i want to exclude..
oh forgot to say thanks ;)
and you should update the file in the first post... it may help some people...
regards,
turbidblue
07-21-2004, 08:57 PM
in regards to this,
$forumids = implode ("', '", get_noaccess_forumids()) ;
will that automatically detect forums that some users are not allowed to view? ot do i need to add the forum ids?
if i need to add them, where in that code??
It works fine on my forum, 3.0.3, until i click on my name and view profile from a thread...then i get an error...
any help??
Logikos
07-24-2004, 09:20 PM
/me clicks install!
Logikos
07-31-2004, 11:51 AM
is there a way to make it in only certain fourmids? seprate with commas?
assassingod
07-31-2004, 12:19 PM
Yep, delete
$forumids = implode ("', '", get_noaccess_forumids()) ;
and replace
WHERE postuserid = '$userinfo[userid]' AND forumid NOT IN ('$forumids')
with
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('x,y,z')
Then use the forumids you wish to use there, in replacement of x,y,z :)
Logikos
07-31-2004, 12:21 PM
you rock man!!! If i could click the install button twice i would :p
assassingod
07-31-2004, 12:26 PM
Thanks:ps
Logikos
08-03-2004, 02:23 AM
Thanks:ps
Theres a slight bug it seems. When i place this code.
$getthreads = $DB_site->query("
SELECT threadid,title,dateline
FROM " . TABLE_PREFIX ."thread
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('27,28,29,30,31,32,11,5')
ORDER BY dateline DESC
");
It only shows the threads in ID 27. Which is the first on the list. It doesn't grab the rest. Any reason why?
Logikos
08-06-2004, 06:27 AM
Any way to do this so just the threads a user starts show up in the profile?
LizerisCHN
08-10-2004, 12:12 AM
Theres a slight bug it seems. When i place this code.
$getthreads = $DB_site->query("
SELECT threadid,title,dateline
FROM " . TABLE_PREFIX ."thread
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('27,28,29,30,31,32,11,5')
ORDER BY dateline DESC
");
It only shows the threads in ID 27. Which is the first on the list. It doesn't grab the rest. Any reason why?
Your code would need to look like this:
$getthreads = $DB_site->query("
SELECT threadid,title,dateline
FROM " . TABLE_PREFIX ."thread
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('27','28','29','30','31','32','11','5')
ORDER BY dateline DESC
");
It needs to define each forumid separately.
Lee Wilde
11-17-2004, 03:51 PM
Very cool. Installed in minutes, thanks!
MajorFm.com
01-15-2005, 01:24 PM
Great hack... however
Step 2:
Open includes/functions_misc.php and find (1 change)
// ###################### Start microtime_diff #######################
Above, add:
// ###################### Start no_access_forumids #######################
// This was originally coded by g-force2k1 - Thanks very much buddy!:)
// gets which forumids users dont have access too
function get_noaccess_forumids ( )
{
global $forumcache, $bbuserinfo ;
$_naforumids = array ( ) ;
$_naforumids[] = 0 ;
foreach ( $forumcache AS $forumid => $farray ) :
if ( ! ( $farray['permissions']["$bbuserinfo[usergroupid]"] & CANVIEW ) ) :
$_naforumids[] = $forumid ;
endif ;
endforeach ;
return $_naforumids ;
}
I get the following error
Fatal error: Cannot redeclare get_noaccess_forumids() (previously declared in /usr/local/apache/www/crazyapes/majorfmforum.com/htdocs/forum/includes/functions_user.php:517) in /usr/local/apache/www/crazyapes/majorfmforum.com/htdocs/forum/includes/functions_misc.php on line 18
Ghostsuit
02-11-2005, 12:42 AM
Looks like you have the same function installed twice. Once in function_user.php and once in function_misc.php
Try removing the misc one and see what happens.
iceytdot
05-10-2005, 06:55 AM
works after i took out that line causing everyone trouble! clicks install thanks for tha hack!
anyone help me
i was installing user threads in (vb3) hack
but i installed user threads(vb3) hack and well i have this error
http://www.oh-twadi.com/forum/member.php?u=24
^^not there its just example of where it was error below
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/ohtwadi/public_html/upload/member.php on line 421
it told me to add this
// THREADS
// By assassingod
// Dont forget to change the variables on line 394
$limit = '5'; // Enter the number of maximum threads you want to be displayed
$forumids = implode ("', '", get_noaccess_forumids()) ;
last line = error line 421
</b>
also i dont get this
// Dont forget to change the variables on line 394
^^^
yoyoyoyo
07-09-2005, 12:32 PM
installed flawlessly in 3.0.7 - thanks!
**clicks install**
i have various errors can someone help me
1st error
while creating new thread
http://www.oh-twadi.com/forum/newthread.php?do=newthread&f=7
Fatal error: Cannot redeclare get_noaccess_forumids() (previously declared in /home/ohtwadi/public_html/forum/includes/functions_misc.php:19) in /home/ohtwadi/public_html/forum/includes/functions_misc.php on line 34
2nd error
while veiwing a profile
http://www.oh-twadi.com/forum/member.php?u=1
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/ohtwadi/public_html/forum/member.php on line 422
can you help me at all
yoyoyoyo
07-10-2005, 05:20 PM
I worked this out with Thug, and got it working for him. If anyone else wants to get this working simply follow the attached instructions instead.
still got a problem now
my members profile shows all threads,even though the limit is at 1
heres my codings
// THREADS
// By assassingod
// functionality fixed by yoyoyoyo
$limit = '1'; // Enter the number of maximum threads you want to be displayed
$getthreads = $DB_site->query("
SELECT threadid,title,dateline
FROM " . TABLE_PREFIX ."thread
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('1','2','')
ORDER BY dateline DESC
"); // enter the forums you wish to exclude in the above array where the numbers represent the forum ID's
while($threads = $DB_site->fetch_array($getthreads))
{
exec_switch_bg();
$threads['date'] = vbdate($vboptions['dateformat'],$threads['dateline']);
$threads['time'] = vbdate($vboptions['timeformat'],$threads['dateline']);
eval('$usersthreads .= "' . fetch_template('memberinfo_usersthreads') . '";');
}
Scribbller
09-27-2005, 08:05 AM
Is it possible that threads from a particular forum be displayed like it happens on VB.org threads in hack forums are displayed in profile.
lonely
11-04-2005, 09:57 AM
there a working version of this for 3.5?
lazyseller
11-22-2005, 02:21 PM
Looking for the same!!!
I worked this out with Thug, and got it working for him. If anyone else wants to get this working simply follow the attached instructions instead.
thank you, your fix worked for me with the exception of limiting the # of threads being shown. :squareeyed: on 3.0.7
So i just changed the phrase to sale "classified ads" and gave it the classified sections to pick from.
$limit = '5'; // Enter the number of maximum threads you want to be displayed
$getthreads = $DB_site->query("
SELECT threadid,title,dateline
FROM " . TABLE_PREFIX ."thread
WHERE postuserid = '$userinfo[userid]' AND forumid IN ('23','24','25','26')
ORDER BY dateline DESC
"); // enter the forums you wish to exclude in the above array ('1','2','3') where the numbers represent the forum ID's
the one area was confusing. as you see i entered in the 2x's, my classifieds. Your setup says to exclude howver for me it was the only way i could get them to be shown in the profile
aveon
06-16-2007, 12:01 PM
hey guys can we get this working for v3.6.x
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.