Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Friends Extension intial developement old-
y2kbg
New
0
This discussion has been closed.
Comments
what do you think?
also here is my code to write to display the link on the account page and write to data base(i am pretty sure it wont do mch as of now as i have not tested it because my web host is still down.
it is pretty much a very modified version of user wall thanks to pol for this
as you can see there are still alot of wall references that need to be fixed.
can someone that knows a little more fix this code up so that it works (and some unnecessary things can probably be removed)
Newer code below
even newer below
/*
Extension Name: Friends
Extension Url: ??
Description: hahahaha
Version: 1.0
Author: Zak
Author Url: zfiles.110mb.com
*/
$Context->Dictionary['AddFriend'] = 'Add As Friend';
//$Context->Dictionary[''] = '';
if (!array_key_exists('friendssqlcheck', $Context->Configuration)) {
$SQL = file_get_contents($Context->Configuration['EXTENSIONS_PATH'] . 'Friends/friends-mysql.sql');
$Context->Database->Execute($SQL, 'Friends', NULL, 'Could not create Friends table');
if ($Context->ErrorManager->Iif()) {
AddConfigurationSetting($Context, 'friendssqlcheck', '1');
}}
if ($Context->SelfUrl == 'account.php' && ForceIncomingString('PostBackAction', '') == '') {
class Friends extends Control {
var $Posts;
function Friends(&$Context) {
$this->Name = 'Friends';
$this->Control($Context);
$NewFriendPost = ForceIncomingInt('u', $this->Context->Session->UserID);
$friender = $this->Context->Session->UserID;
if (($NewFriendPost = ForceIncomingString('friendid', ''))) {
$result = mysql_query("INSERT INTO LUM_Friends(UserID, Friend) VALUES ('$friender', '$NewFriendPost')");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
}
}
function Render() {
$this->CallDelegate('PreRender');
$FriendUserID = ForceIncomingInt('u', $this->Context->Session->UserID);
$selfID = $this->Context->Session->UserID;
$friends = mysql_query("SELECT Friend FROM LUM_Friends WHERE UserID = '$selfID'");
if (!$friends) {
die('Invalid query: ' . mysql_error());
}
$listoffriends = array();
$listcount = '';
while ($row = mysql_fetch_array($friends)) {
$listoffriends[$listcount]= $row['Friend'];
$listcount++;
}
if (in_array($FriendUserID, $listoffriends)) {
echo " I am Your Friend";
}
else{
echo '' . $this->Context->GetDefinition('AddFriend') . '';
echo 'Context->Configuration, 'account.php', '', 'u', $FriendUserID) . '">';
echo '
' . 'Cancel' . '
';}
}
}
$Page->AddRenderControl($Context->ObjectFactory->NewContextObject($Context, 'Friends'), $Configuration['CONTROL_POSITION_BODY_ITEM']);
}
?>
Ok i have got this to the point where:
1. It creates the table correctly
2. adds link and conformation submit button to the account pages
3. when submit is clicked it attempts to write to database but i get this error:
Affected Elements Friends.Friends(); The error occurred on or near: Table 'zfiles_vanillas.LUM_' doesn't exist
I must be using the sqlbuilder wrong because it does not add my table name to the table name(as shown by the error message because it is just the prefix)
If someone would tell me what i did wrong and what to do to fix this i would greatly appreciate it.
I have updated the uploaded extension also and given a good screenshot too.
http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=234
When you view an account you will see a link that says add as friend you will be asked to confirm and then once they are you friend it will say I am Your friend on there account.
if anyone has ideas suggestions please say.
http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=234
Does anyone know of a way to fix this?
http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=234
For the lazy (like me) Friends 1.0 Extension.
Friends 1.0 Extension