Mod Name / Version: Who's Online PM Link 1.0Descriptio..."> Mod Name / Version: Who's Online PM Link 1.0Descriptio...">
 
Previous Thread
Next Thread
Print Thread
Rating: 3
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ready for prime time and working in 6.1. <img src="/threads/php/images/icons/wink.gif" alt="" />

Mod Name / Version: Who's Online PM Link 1.0

Description: This little hack adds a "Send a PM" button next to each user on the Who's Online Screen

Screenshot: See Below.

Working under: UBB.threads 6.0.1, 6.0.2, 6.0.3, 6.1

Any pre-requisites: None

Author(s): JoshPet

Credits: Saw it on another BB system

Files Altered: online.php, online.tmpl

Database Altered: No

New Files: None

Screenshot:
[]http://www.pettitfamily.net/josh/OnlinePMScreen.gif[/]
Attachments
54625-WhosOnlinePMLink1.0.txt (0 Bytes, 127 downloads)

Sponsored Links
Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
Cool, works great!


Silly ricer.. Wings are for airplanes!
Joined: Mar 2000
Posts: 63
Member
Member
Offline
Joined: Mar 2000
Posts: 63
Hi JoshPet, I installed this hack on 6.0.3 and it appears to work fine (i.e. the link appears in the WO page and links to a page where the username is entered properly) however when I try to post the message I get the error

"We have no record for the Username that you are trying to send this message to."

even though it is the correct username. Could this be because I have "allow special charachters in username in config options"? Although even when I have this set and try usernames which do not have spec chars it still does not work.

Any idea what could be causing this please?

BTW the url of the link in the case og 'guest' is:

http://mydomain/sendprivate.php?Cat=&User=guest

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
There was a previous version of this hack for 6.0.x, perhaps you would have better luck with it?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Does it do it just for usrenames with special characters.

I had this running for a month or two on a 6.0.3 site... never had a problem. I was probably the one who used it the most.

You might check what the link should look like.... if special characters are turned on. Look at their profiles and mouse over the "Send a private Message" link..... that link should be the same as the one used in Who's online. That's really all it does. But maybe it does something I'm not aware of when you have special characters turned on.


Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
If you're having problems with spaces in user names, I have some instructions about how to let spaces work when you have the special characters disabled. One of the Daves posted them and I saved it.

Joined: Mar 2000
Posts: 63
Member
Member
Offline
Joined: Mar 2000
Posts: 63
Please ignore my point above:

"Hi JoshPet, I installed this hack on 6.0.3 and it appears to work fine (i.e. the link appears in the WO page and links to a page where the username is entered properly) however when I try to post the message I get the error..."

This was due to a silly mistake I made when editing the template.

Sorry and thanks for your help.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
I´m working on forum specific templates.

In showflat and showthreaded I want to change the reply link to a PM link.

I think I know how to ad what I need in the tmpl´s, but how do I modify the code written for onlie.php to work in showflat.php and showthreaded.php?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
So you want to replace the "Reply" button with a link that sends a PM to that user?

If so... I can look at this later this evening for you.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Yes, that´s what I want to do! Would be great!

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Wanted to make sure.

Should be easy. Will look at this evening.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Thanks!

I´m rebuilding the forum completly thanks to all the help at the different dev. forums.

This could bee really cool at the end... if there is such a thing as an ending in this case!


Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Haven't tested this...

but this should change the "Reply" link to a link which will reply via Pm instead.

It *should* work for you. Please report back and let me know how you made out. If it's a thumbsup.... I'll post this as a separate mod.
Attachments
59427-replyviapmlink.txt (0 Bytes, 48 downloads)

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
This worked great!

But I need showflat.php and showthreaded.php to use this only on specified forums using separate tmpl´s. All the other forums should work as normal.

Like this:

I have duplicated showthreaded.tmpl, showflat.tmpl and postlist.tmpl.

The duplicates are renamed to showthreadedhard.tmpl, showflathard.tmpl and postlisthard.tmpl.

In these files I´ve made my changes and then uploaded the files to templates/default.

In postlist.php, showflat.php and showthreaded.php I´ve done this (based on this mod. ):

I´ve changed this in postlist.php:
code:

include ("$thispath/templates/$tempstyle/postlist.tmpl");



to this
code:

if ($Board == "supertest") {
include ("$thispath/templates/$tempstyle/postlisthard.tmpl");
}
else {
include ("$thispath/templates/$tempstyle/postlist.tmpl");
}




I´ve done the same in showflat.php and showthreaded.php, but with links to their specific templates, of course.


Later on, when the supertest forum is complete and ready for launch, I will change this:

code:

if ($Board == "supertest") {



to this
code:

if ($Board == "supertest" or $Board == "specialforum1" or $Board == "specialforum2" or $Board == "specialforum3") {



Supertest is my development forum, with admin only access. specialforum1, 2, 3, 4 etc is the not yet created forums that will use these modified features. There will be at least 15 of these special forums at the launch. All other forums will work as normal.

Is it possible to ad something like the change I´ve done in postlist.php, showlist.php and showthreaded.php, but instead of telling the x.php file what tmpl´s to use it states what link, PM or Reply, that should be used if the forum is a normal or modified one?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You could set up the replylnkstart and replylinkstop inside an if statement.....

Put the "if this board" .... then the coding I gave you for the reply link.... then "else" and the coding that was there. That should do the trick.

If you need specific help, I can write something up this evening.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Worked just great!

Wrote it like this:
code:
if ($Board == "supertest") {

$postrow[$i]['replylinkstart'] = "<a href="{$config['phpurl']}/sendprivate.php?Cat=$Cat&User=$EUsername">";
$postrow[$i]['replylinkstop'] = "</a>";
}
else {

$postrow[$i]['replylinkstart'] = "<a href="{$config['phpurl']}/newreply.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&what=showflat&sb=$sb&o=$o&fpart=$fpart&vc=1">";
$postrow[$i]['replylinkstop'] = "</a>";
}




Now I have another problem, wich I think is far more complicated to work around.

I´m going to use these new forums as areas for personal ads. I want registered users to be able to advertise anonymously and recive answers to their UBBT account.

So what I need to do now is hide the posters username in every place it might show up. Commenting out (or mark as hidden) the recipent field in the PM window is not such a big deal, but a posters username shows up in so many different places: the link to the PM window, in various places showing new posts, in the posters sent messages box, etc etc.

Am I asking for to much here? Is this at all possible?


Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Wow.... that would be tough... and you can't fix the URL problem.

6.2 will be based on user number...which will fix the problem of the name showing in the URL.

I've got an idea.... I wonder if you can have user's post their replies.... but somehow rig those forums so that only the original poster could view the replies.

Almost like a private topic thing that we discussed here a while ago.

Might be pretty complicated though.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Hmm... sounds like it´s a better idea to find an existing ads system and integrate with UBBT?! Know ´bout one that might work?

I really would like to have it all in UBBT, but if it´s such a big operation....

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Lemme
tinker this weekend.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Sure!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I took a quick look... and have this working on showflat.php..... I didn't look at showthreaded yet..... because there are some problems that I don't know how to work around.

While I kinda got it..... the whole thing is probably just out of my reach... maybe with enough hacking around it could be done. It would certainly take me alot more free time than I've got.

What this does.... (in showflat view) is only show the replies to the person who started the topic... everyone else only sees the main post:

The problems that I noticed off the top of my head:
- the replies would show up in a search
- the replies would show up when someone "showed all posts by this user"
- when the user makes a reply...they can "view their post" then see the whole thread

code:

##
## Open showflat.php
##

#
# Find this:
#

// -----------------------------------------
// Grab the main post number for this thread
$Number = addslashes($Number);
$query = "
SELECT B_Main
FROM {$config['tbprefix']}Posts
WHERE B_Number = '$Number'
AND B_Board = '$Board'
";
$sth = $dbh -> do_query($query);
list ($current) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);

#
# Change to:
#

// -----------------------------------------
// Grab the main post number for this thread
$Number = addslashes($Number);
$query = "
SELECT B_Main, B_Username
FROM {$config['tbprefix']}Posts
WHERE B_Number = '$Number'
AND B_Board = '$Board'
";
$sth = $dbh -> do_query($query);
list ($current,$MainUsername) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);


#
# Find this:
#

// -----------------------------------------------------------------
// We need to know how many posts of this thread to display per page
if ($fpart <= 1) {
$Totalgrab = $Totaldisplay;
}
else {
$Startat = $Totaldisplay * ($fpart - 1);
$Totalgrab = "$Startat, $Totaldisplay";
}
$Limit = "LIMIT $Totalgrab";
if ($fpart == "all") {
$Limit = "";
}

$threadnumber = $Number;


#
# Change to this:
#

// -----------------------------------------------------------------
// We need to know how many posts of this thread to display per page
if ($user['U_Username'] == $MainUsername) {
if ($fpart <= 1) {
$Totalgrab = $Totaldisplay;
}
else {
$Startat = $Totaldisplay * ($fpart - 1);
$Totalgrab = "$Startat, $Totaldisplay";
}
$Limit = "LIMIT $Totalgrab";
if ($fpart == "all") {
$Limit = "";
}
}
else {
$Limit = "LIMIT 1";
}

$threadnumber = $Number;



Since you need this in a bunch of boards... you would need to add a lot of "if the board is xxxxxxx" then have it check if the $user['U_Username'] was equal to the B_Username of the main post.
There would be lots of scripts you'd have to work this into.

But in theory it's probably possible.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Oki... I give up!

Guess I´ll have to find an existing system and integrate the login with UBBT.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
With 6.2 it will be user number based.

So then if you did the private message idea... you wouldn't see the username in the URL... just the number, which would still be anonymous.

You could easily remove the option to "keep a copy of this message" from the PM templates... which is another identity give away.

What's this for again? Like a personals response thing?

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Oki... But how far away is 6.2?

Yes, it for personals. I want to give my registered user an anonymous personal advertisment area. "Man seeks Woman", Woman seeks Alien", "Alien seeks MiB".

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No official word yet as to a time frame.

I know it's still in development and hasn't even entered beta yet... so I wouldn't wait on it.


Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Ok

I´ll start looking for an allternative system asap. Thank you for helping!

Joined: Aug 2002
Posts: 109
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 109
Got this working with 6.2 BR2...It's really easy (hey, I figured it out...musta been easy;) )

All you have to do is in this:

code:

//------------------------------------------------------
// Set up the link to send the user a Private Message - by JoshPet
if ($config['private']) {
$encoded = rawurlencode($Username);
$privmessage = "<a href="{$config['phpurl']}/sendprivate.php?Cat=$Cat&User=$encoded"><img src="{$config['images']}/sendprivate.gif" alt="{$ubbt_lang['PRIV_HEAD']}" border="0"></a>";
}




Change
code:
$encoded = rawurlencode($Username);


to
code:
$encoded = rawurlencode($Uid);


Works just fine for me now

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
This one gonna work on 6.2.2? Just trying to keep Josh busy

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Yes, it'll work if you apply the change cstaber posted above.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Will this work with 6.4?

Joined: Feb 2001
Posts: 104
Journeyman
Journeyman
Offline
Joined: Feb 2001
Posts: 104
[]Gregori said:
Will this work with 6.4? [/]

Yes.

If I remember right, you need to change the following in the instructions.

Code
 ABOVE it, add this:<br /><br />	//------------------------------------------------------<br />	// Set up the link to send the user a Private Message -  by JoshPet<br />      if ($config['private']) {<br />         $encoded = rawurlencode($Username);<br />         $privmessage = "<a href=\"{$config['phpurl']}/sendprivate.php?Cat=$Cat&amp;User=$encoded\"><img src=\"{$config['images']}/sendprivate.gif\" alt=\"{$ubbt_lang['PRIV_HEAD']}\" border=\"0\"></a>"; <br />      } 


change the encoded $Username to $EUsername and it'll work.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)