anpera.net

anpera.net

experimental server @home
Aktuelle Zeit: Mo 09 Jun, 2025 08:13

Alle Zeiten sind UTC + 1 Stunde




Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: key refund
BeitragVerfasst: Sa 15 Mär, 2008 20:14 
Offline
Newbie

Registriert: Sa 02 Dez, 2006 08:17
Beiträge: 7
Wohnort: Italy
I installed the royal estates of anpera, mod that I find fantastic, but I would like to ensure that you can return the keys unwanted, I have tried so but does not work, someone could help me?

Zitat:
}else if ($_GET[op] =="returnkey"){
output("You have decided to return the key of the estate to the owner!");
$sql="SELECT * FROM houses WHERE houseid=".$session[user][housekey]." ";
$result = db_query($sql) or die(db_error(LINK));
$row = db_fetch_assoc($result);
systemmail($row[owner],"`@key returned!`0","`&{$session['user'] ['name']}`2 you returned the key to your house!");
$sql = "UPDATE items SET owner = ".$row[owner]." WHERE owner=".$session[user][acctid]." AND class='key' AND value1=$row[houseid]";
db_query($sql);
addnav("back","houses.php");


Zitat:
addnav("Sonstiges");
$sql="SELECT * FROM houses WHERE houseid=".$session[housekey]." ";
$result = db_query($sql) or die(db_error(LINK));
$row = db_fetch_assoc($result);
if ($row[owner]<>$session[user][acctid])
addnav("key refund","houses.php?op=returnkey");

_________________
Pan


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: key refund
BeitragVerfasst: So 16 Mär, 2008 10:28 
Offline
Freak
Freak

Registriert: So 30 Okt, 2005 17:48
Beiträge: 1408
Wohnort: PB
Geschlecht: Männlich
LoGD: http://dav.blood-reaver.de/lotgd/
Hi pandrex,

I think your problem depends on the field "housekey" in the accounts table/$session[user] array.
As far as i know it it just used to identify which house a user owns.
It you want those, who are "guests" in the house, to be able to give back their keys, i would reccomend to find the id of the house using a $session or $_GET variable.

I'm sorry if there might be mistakes... i worked with other house systems the last time and might be confused about then ;-)

Auric

_________________
Mehr oder minder inaktiv


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: key refund
BeitragVerfasst: So 30 Mär, 2008 15:15 
Offline
Newbie

Registriert: Sa 02 Dez, 2006 08:17
Beiträge: 7
Wohnort: Italy
I have tried in all ways, but I fail to make it work, but I am sure that anpera or eliwood do work in a moment.

_________________
Pan


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: key refund
BeitragVerfasst: Mo 31 Mär, 2008 11:16 
Offline
Admin
Admin
Benutzeravatar

Registriert: Di 21 Jan, 2003 01:11
Beiträge: 1604
Wohnort: Haßfurt
Geschlecht: Männlich
LoGD: http://www.anpera.net/logd
Skype: anpera-net
A script to throw away keys without returning them to the owner can be found here. It makes house owners to think more about who they give a key. If they are not careful they lose a key and have to buy a new one in Hunter's Lodge. ;)

The latest houses.php contains a way for the house owner to take back his keys. (I don't know if it was possible in the english translation.)

For the more friendly habitants of LoGD who want to give back unwanted keys, it is the best to do it by item ID - just in case that there are more than one keys to a house.
The easiest (not the best) way for this is to give the item ID of the key and the ID of the house through the nav.

Example:
All keys that give access to other's houses are listet in navs and can be returned. This would work as a separate script as well and doesn't have to be put into houses.php. I recommend not to enable users to give back keys while they are guests in the house.
$this->bbcode_second_pass_code('', '...
// get all guest keys of the user for all houses
$row=db_query('SELECT * FROM items WHERE class="key" AND owner='.$session['user']['acctid'].' AND value1<>'.$session['user']['house'].' ORDER BY value1');
// generate navs to return guest keys
addnav("Return key");
y=db_num_rows($row);
for (x=0;x<y;x++){
$item=db_fetch_assoc($row);
addnav("for house ".$item['value1'],"xy.php?op=returnkey&itemid=".$item['id']."&houseid=".$item['value']); // not the best way to 'show' those values in the navs!
}
...')
$this->bbcode_second_pass_code('', '...
}elseif ($_GET['op']=="returnkey"){
// return selected key to house owner
$house=db_fetch_assoc(db_query('SELECT owner FROM houses WHERE houseid='.(int)$_GET['houseid']));
db_query('UPDATE items SET owner='.$house['owner'].' WHERE id='.(int)$_GET['itemid']) or die(db_error(LINK));
}
...')
(Not optimized, not tested!
Replace class="key" by class="Schlüssel" for German version.)

Did this help you?

_________________
Praxis ist, wenn alles klappt aber keiner weiß warum. Theorie ist, wenn man weiß wie es geht, aber nichts klappt. Wir haben beides erfolgreich vereinigt: Bei uns klappt nichts und keiner weiß warum!

Neues Video: Marios freier Tag in Second Life


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 12 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen
Du darfst keine Antworten zu Themen in diesem Forum erstellen
Du darfst deine Beiträge in diesem Forum nicht ändern
Du darfst deine Beiträge in diesem Forum nicht löschen
Du darfst keine Dateianhänge in diesem Forum erstellen

Suche nach:
Gehe zu:  
POWERED_BY
Deutsche Übersetzung durch phpBB.de
anpera.net - Impressum