Sending URL bbcode in a PM using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Sending URL bbcode in a PM using php

Post by davidprogramer »

The bold tag works, the color tag works. Why wont the url tag work???

Here is the code~

Code: Select all

$message = "
[url=\"modules.php?name=join_clan&op=accept&pid=$player_id&cid=$clan_id\"]<< ACCEPT >>[/url]
[url=\"modules.php?name=join_clan&op=reject&pid=$player_id&cid=$clan_id\"]<< REJECT >>[/url] ";


// Begin sending the PM.
$pm_subject = "Clan Invite from $clan_tag";
$privmsgs_date = time();

$recieving_user_profile = sql_query("SELECT user_id, username FROM ".$prefix."_users WHERE user_id = $recieving_user");
list($user_id, $username) = sql_fetch_row($recieving_user_profile);

$message = "$message";
$subject = "Clan Invite from $clan_tag";
if(empty($message) || empty($subject)) {
	return;
}
$bbcode_uid = make_bbcode_uid();
$privmsg_message = prepare_message($message, 1, 1, 1, $bbcode_uid);
$sql = "INSERT INTO nuke_bbprivmsgs (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date ) VALUES ('1', '".$subject."', '$sending_user', '$recieving_user', ".$privmsgs_date.")";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
   echo "Could not insert private message sent info";
}
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

If this is for phpbb, then there shouldn't be any quotes around the URL in the [url] tags.
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Post by davidprogramer »

Code: Select all

[url=modules.php?name=join_clan&op=accept&pid=$player_id&cid=$clan_id]<< ACCEPT >>[/url]
[url=modules.php?name=join_clan&op=reject&pid=$player_id&cid=$clan_id]<< REJECT >>[/url] ";
still doesnt work -_-
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

<< REJECT >>

you need the http://www.domain.com or http://domain.com in there. Notice how it won't even parse here without domain
davidprogramer
Forum Commoner
Posts: 64
Joined: Mon Nov 28, 2005 6:11 pm

Post by davidprogramer »

Thanks again JCart :wink:
Post Reply