PDA

View Full Version : List of threads a member has started


Grendel
08-27-2002, 06:43 AM
Is this possible:

I want to show all threads a member has started (of chosen forums).
I run vb on a literature-page and want to make a list of all stories a member has posted.

Any help would be great.

Logician
08-27-2002, 07:01 AM
Originally posted by Grendel
I want to show all threads a member has started (of chosen forums).

Where? (On user profile? with a click to a link to search them? etc.)

Grendel
08-27-2002, 08:35 AM
In the User-Info at the right side of a thread etc., where the avatar, status, etc. are shown. There one should find a link to all threads a member has started.
The list shouldn't be build from all forums but from forums the admin is choosing (in the hack). Thats because only stories should be listed, not the other forums (like website-discussion etc.).

Sorry for my poor english, I'm just a stupid German ;)

Logician
08-27-2002, 10:44 AM
Here you go.. ;)

FYI. this hack increases your query load in postbit loads to a certain extent since it needs to query your database to get users' threads in forum X.

Grendel
08-27-2002, 10:56 AM
Great! *hug* *kiss* and so on ;)

(I hope it won't increase the load too much)

Logician
08-27-2002, 02:54 PM
Originally posted by Grendel
(I hope it won't increase the load too much)
new load=old load+number of posts the viewer views in thread view

Grendel
08-27-2002, 05:50 PM
Hm, something is wrong:

Parse error: parse error in /homepages/.../htdocs/vb/admin/functions.php on line 90

Fatal error: Call to undefined function: getuserinfo() in /homepages/.../htdocs/vb/admin/sessions.php on line 324

The parse error is gone, just needed to replace some ' for some ".
But the Fatal error now is:

Fatal error: Call to a member function on a non-object in /homepages/.../htdocs/vb/admin/functions.php on line 90

g-force2k2
08-27-2002, 05:53 PM
there's probably a coding error in the hack that you just installed either that or you mis-hacked the admin/functions.php from the error that im seeing... regards...

g-force2k2

Grendel
08-27-2002, 06:00 PM
It's nearly impossible to mis-hack ;)

See my edited posting.

Logician
08-27-2002, 06:33 PM
Originally posted by Grendel
Hm, something is wrong:

Sorry.. "before" in the second step must be "after". ie.

Find
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function getpostbit($post) {
// sorts through all the stuff to return the postbit template
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

After that add
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
extract ($GLOBALS);
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This will fix "Call to a member function on a non-object " error..

However there should not be any parse error, there is no here.. I tested it and it's working..

Grendel
08-27-2002, 08:48 PM
Yes, it works!
I don't want to get on your nerves but:

Now it builts a lis right at the postbits. I want to have a link in the postbits leading to a seperate list of started threads. Would this be possible too?

Thanks again for your work!

Logician
08-27-2002, 09:07 PM
Originally posted by Grendel
Yes, it works!
I don't want to get on your nerves but:

Now it builts a lis right at the postbits. I want to have a link in the postbits leading to a seperate list of started threads. Would this be possible too?

Thanks again for your work!
oh I thought you want it this way..

Try this.. I made a quick modification and I didnt test it so holler if it does not work.. And a good news: if you apply this hack, SQL load will not be affected unlike the prior one..

Grendel
08-27-2002, 09:31 PM
exit;

// Logician Display User's Threads in forum X in postbit hack}


should be

exit;
}
// Logician Display User's Threads in forum X in postbit hack

Now, if I click at the link, I get the lostpw-Form. How comes this?

I think something is missing in this link:

member.php?s=$session[sessionhash]&postuserid=$post[userid]

Grendel
08-28-2002, 06:38 AM
And I didn't used the lostpw-template, if that would be your next question ;)

Logician
08-28-2002, 07:32 AM
ok I fixed the problems and updated the file, try again..

You may get the old (cached) file so try to download it by choosing right click and save as a file.

And it's working now.. Tested..;)

Grendel
08-28-2002, 07:43 AM
Whatever I do, it's not working. Here is one of the links I get:

<a href="member.php?s=&postuserid=2474">Stories</a>

URL: http://www.short-stories.de/vb/

And if click on this all I get is the Lost-Password-Form.

My userthreads-template:


{htmldoctype}
<html>
<head><title>$bbtitle - Geschichten</title>
$headinclude
</head>
<body>
$header

<br>

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}"><b>Geschichtenliste</b></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}">$post[specialthreads]</td>
</tr>
</table>
</td></tr></table>


$footer

</body>
</html>

Grendel
08-28-2002, 07:48 AM
Oh, You changed the link too. Sorry, testing now.

Grendel
08-28-2002, 07:52 AM
Works! GREAT! Thank you very much.

Grendel
08-28-2002, 08:11 AM
Now, to make this hack perfect:

- I want to list threads from more than one forum, how do I do that?
The following I want to show in the list too:
- Date of starting the thread
- User-Name (as headline)
- Categories

:)

Logician
08-28-2002, 08:20 AM
Originally posted by Grendel
Now, to make this hack perfect:

- I want to list threads from more than one forum, how do I do that?
Replace

AND forumid=X

as

AND (forumid=X OR forumid=Y OR forumid=Z)

The following I want to show in the list too:
- Date of starting the thread
- User-Name (as headline)

if ($action=="showthread") {
extract ($GLOBALS);
$users_t=$DB_site->query("SELECT threadid, title,postusername, dateline FROM thread WHERE postuserid=".$postuserid." AND forumid=X AND visible=1");
while ($users_threads=$DB_site->fetch_array($users_t)) {
$post[specialthreads].="<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">'.$users_threads[title].'</a> ('.vbdate($dateformat,$users_threads[dateline]).')<br>';
$postusername=$users_threads[postusername]
}
if (!$post[specialthreads]) {$post[specialthreads]='N/A';}
eval("dooutput(\"".gettemplate("usersthreads")."\");");
exit;
}

Use $postusername in your template to refer Poster name

Grendel
08-28-2002, 08:40 AM
if ($action=="showthread") {
extract ($GLOBALS);
$users_t=$DB_site->query("SELECT threadid, title,postusername, dateline FROM thread WHERE postuserid=".$postuserid." AND forumid=X AND visible=1");
while ($users_threads=$DB_site->fetch_array($users_t)) {
$post[specialthreads].="<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">'.$users_threads[title].'</a> ('.vbdate($dateformat,$users_threads[dateline]).')<br>';
$postusername=$users_threads[postusername]
}
if (!$post[specialthreads]) {$post[specialthreads]='N/A';}
eval("dooutput(\"".gettemplate("usersthreads")."\");");
exit;
}



if ($action=="showthread") {
include("./global.php");
extract ($GLOBALS);
$users_t=$DB_site->query("SELECT threadid, title,postusername, dateline FROM thread WHERE postuserid=".$postuserid." AND forumid=X AND visible=1");
while ($users_threads=$DB_site->fetch_array($users_t)) {
$post[specialthreads].="<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">'.$users_threads[title].'</a> ('.vbdate($dateformat,$users_threads[dateline]).')<br>';
$postusername=$users_threads[postusername];
}
if (!$post[specialthreads]) {$post[specialthreads]='N/A';}
eval("dooutput(\"".gettemplate("usersthreads")."\");");
exit;
}


Works fine!
Now only the categories are missing. And then it's done and perfect and a great and useful hack!

Thank you very much again!

Logician
08-28-2002, 08:44 AM
what do you mean by categories?

Grendel
08-28-2002, 08:47 AM
And
<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">
must be
<a href=\"showthread.php?s=".$session[sessionhash]."&threadid=".$users_threads[threadid].'">

Grendel
08-28-2002, 08:48 AM
Sorry, not Categories. I mean the forums, where that posting is in.

Grendel
08-28-2002, 09:05 AM
If one has no stories in the list, the username is not available too - could this be fixed?

Oh, I added this:

AND visible=1 AND sticky=0");
So, all sticky-threads (mostly info-threads of mods and admins) are not listed.

Grendel
08-30-2002, 06:36 AM
Is it possible to show the forums where that posting is in? Would be great.

Logician
08-30-2002, 07:44 AM
Use:

if ($action=="showthread") {
extract ($GLOBALS);
$users_t=$DB_site->query("SELECT thread.threadid, thread.title,thread.postusername, thread.dateline, forum.title as forumtitle FROM thread LEFT JOIN forum ON forum.forumid=thread.forumid WHERE thread.postuserid=".$postuserid." AND thread.forumid=X AND thread.visible=1");
while ($users_threads=$DB_site->fetch_array($users_t)) {
$post[specialthreads].="<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">'.$users_threads[title].'</a> ('.vbdate($dateformat,$users_threads[dateline]).') ['.$users_threads[forumtitle].']<br>';
$postusername=$users_threads[postusername];
}
if (!$post[specialthreads])
{
$post[specialthreads]='N/A';
}

if (!$postusername)
{
$users_t2=$DB_site->query_first("SELECT username FROM user WHERE userid=$postuserid");
$postusername=$users_t2[username];
}
eval("dooutput(\"".gettemplate("usersthreads")."\");");
exit;
}

Grendel
08-30-2002, 11:19 AM
Forums in list works, username if no postings doesn't :(

Nevertheless - thank you for your work on this!

Logician
08-30-2002, 11:36 AM
edited.. try again..

Grendel
08-30-2002, 12:38 PM
Hm, I don't see any change to te code before. Can you tell me, what exactly has changed?

Logician
09-01-2002, 08:16 AM
added a missing $ to if (!$postusername)

Grendel
09-01-2002, 08:36 AM
:banana:
Perfect! Thank you for all the work and your support.

Logician
09-01-2002, 08:38 AM
working ok now?

Grendel
09-01-2002, 04:03 PM
Yes, right like I need it! Thank you!

I attach the end-file, with a table for nicer output and I removed two errors.

Great job!!

Mathiau
11-16-2002, 08:44 PM
shall try this out.

Grendel - do u have a screen shot of the finished product?

Grendel
11-16-2002, 09:00 PM
No, sorry.

But you don't really need one - its just a simple table with 3 rows: Title of started thread; forum; date.

Mathiau
11-20-2002, 11:19 AM
can u visit:

https://vborg.vbsupport.ru/showthread.php?s=&postid=323950#post323950

Mathiau
11-25-2002, 01:09 AM
Originally posted by Grendel
Yes, right like I need it! Thank you!

I attach the end-file, with a table for nicer output and I removed two errors.

Great job!!

well 8m i downloaded and tried your file- but istill get the lost password screen?


Also - is it possible to put besod "stories: the number of posts?>

So ite would look like

Stories: 14

???? but still have the link as well to another page will all posts n it?

Grendel
12-10-2002, 08:27 PM
I don't know, sorry. But I'm working on something like this right now.

a43079
12-12-2002, 09:30 AM
nice hack