Jump to content

Recommended Posts

Posted

this script shows all clanhalls (Name,Location,Lease,Paid until), if clanhall is free, in column paid until will shows "Free"

 

Screen

1009287_clanhalls.png

 

Script

<?php
$username = "root"; //your mysql username
$password = "root"; //your mysql password
$host = "localhost"; //your mysql host
$database = "l2jdb"; //your mysql/lineage database

mysql_connect($host,$username,$password) or die(mysql_error()); 

mysql_select_db($database) or die(mysql_error());

$query = mysql_query("SELECT name,location,lease,paidUntil FROM clanhall ORDER BY location ASC");

  print "<table>";

  print "<tr bgcolor='#707070' style='color:#ffffff;'><th>Name</th><th>Location</th><th>Lease</th><th>Paid until</th></tr>";


$i=1;  


  while($row=mysql_fetch_array($query)){
if($i%2==0){
	$bgcolor='#e3e3e3';
}else{
	$bgcolor='#a6a6a6';
}
if($row[paidUntil]==0){
	$paiduntil="Free";
}else{$paiduntil=$row[paidUntil];}



    print "<tr bgcolor='" . $bgcolor . "'><td>" . $row[name] . "</td><td>" . $row[location] . "</td><td>" . $row[lease] . "</td><td>" . $paiduntil . "</td></tr>";  

$i++;

  }

  print "</table>";

?>

 

Credits: Me (DarkKnight / DarkKnightCZ)

 

 

but cant guarantee paid until (dont have syntax of that table), if someone sends me syntax of paidUntil (in clanhalls table in database), i will update it

 

and if you wanna script for showing free clanhalls only or if you wanna add some collumn (like owner), just tell :)

Posted

Very Nice man thanks .... keep it up...

so i can understand is this like a npc? a command? only for admins?

Its for Site side... its shows
(Name,Location,Lease,Paid until), if clanhall is free, in column paid until will shows "Free"

........Btw .my question is... can i use this one ... for ucoz template... ?

Posted

HouLiGaN : no, it is for website :)

crazynoodle: i think it would work, but i dont know, how ucoz works, so if you send me it, i can modify it and post here guide :)

 

//edit

 

Leki: but if you have apache server with mod_php, it will work :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...