Jump to content

Recommended Posts

Posted

=======================1st update of the post============================

-added clan name

-top online now show time not timestamp

-added raidboss status

Download links:

rbstatus.php

toponline.php

toppk.php

toppvp.php

 

ps:this are my first lines of php:D

 

==========================Original post=================================

Download links :

 

toponline.php

toppk.php

toppvp.php

 

 

Guild :

 

I will take top pvp and explain how to use it:

 

1) you will need a php server: easyphp for windows and lamp for linux will work perfectly

2) locate you www folder and paste the page.php there

3) open the page.php and start the  configuration:

 

 

 

$dbuser="root"; <= replace root with your mysql username

$dbpass="123123"; <= replace with mysql user's password

$dbname="l2jdb"; <= your gameserver data base

$NumberOfResults="20"; <= replace 20 with the number of results you want

 

4) test it!

 

like it is set now it will generate a html page with black background and a table in a middle. I don't host my site on the same pc like the server . On my site i've made iframes and just put the src="serverip/toppvp.php" and will work perfectly

 

 

       Now i will explain how this works:

 

 

$dbuser="root";
$dbpass="123123";
$dbname="l2jdb";  //the name of the database
$NumberOfResults="20";//	
$chandle = mysql_connect("localhost", $dbuser, $dbpass) or die("Connection Failure to Database"); 

this  connects the php server to mysql server if failds returns the message("xxxx")

 

mysql_select_db($dbname, $chandle)

 

selects the db you will work from the connection created above

 

$sql="select characters.char_name,characters.pvpkills,char_templates.ClassName,characters.online from characters,char_templates where characters.classid=char_templates.Classid order by characters.pvpkills DESC LIMIT ".$NumberOfResults;

 

 

For sql users this is clear but i will explain for others:

 

This scripts "select" the char_name from table characters and pvpkills from table character  and classname from char_templates

 

After from it declares the tables it will work on so : characters and char_templates

 

But it will select only the records where char_template id is the same with char...so it will return only the baseclass name

 

it will order by pvp kills so you will get only top recors

 

And finaly the maximum limit of results will be 20

 

 

 

echo"<html><head></head><body bgcolor='#000000' style='color:rgb(200,200,200)'>";
echo "<table  border='2' align=center width=500>";
echo "<tr><th>Nr.</th><th>Name</th><th>Pvp Kills</th><th>Main class</th><th>Status</th></tr>\n";

 

generates the 1st part of the html page and the begining of the table for records

 

$nr=1;
if ($result=mysql_query($sql)or die("Bed Sql syntax")) {
 while ($row=mysql_fetch_row($result)) {
 echo "<tr><td align=center>".$nr."</td>";
 $nr++;
   echo "<td align=center>".$row[0]."</td>";
   echo "<td align=center>".$row[1]."</td>";
echo "<td align=center>".$row[2]."</td>";
if($row[3])
{echo "<td align=center style='color:rgb(0,255,0)'>Online</td></tr>\n"; }
 else{echo "<td align=center style='color:rgb(255,0,0)'>Offline</td></tr>\n";}
 }
} else {
 echo "<!-- SQL Error ".mysql_error()." -->";
}

 

if the result of executing "mysql_query($sql)" dosn't faild , while there is a other line in the result creastes a new line in table and if there is a error report it,,,

 

echo "</table></body></html>";

finish the table and the html page

 

 

 

 

(i haven't sleep 3 h in the last 2 days...so don't kill me if my language is broken)

 

 

 

Posted

Thanks for your share Hardstyle but you could make it easier by uploading your 3 php files in a .rar..Thanks!

i didn't put them in 1 rar cuz i want 2 make more and update this post...not 2 spam mxc with new posts...and it will be easyer for ppl to take what they want

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.



  • Posts

    • Done. Thanks for your choose and trust us, we are the only and LAST, authentic L2OFF Service.
    • sell adena l2rebon signature x1 - 1kk = 1 dollars l2reborn x10 - 500kk = 4.7 dollars E-Global x Lu4 - 1kk = 2.7 dollars BOHPTS - x20-x500 TOP PRICE DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO
    • Hello send me on discord to receive the files source packages you order fron team, thanks you.
    • 亲爱的 SocNet 用户! 我们想向您介绍我们平台当前的促销和特惠活动列表: 1. 在 9 月使用优惠码 SEPTEMBER2025(9 折优惠)即可在我们的商店(网站、机器人)购物!您还可以在首次购买时使用优惠码:SOCNET(85 折优惠) 2. 获得 $1 商店余额或 10-20% 折扣,只需在我们网站注册后按照以下模板填写您的用户名: "SEND ME BONUS, MY USERNAME IS..." ——需要在我们的论坛主题帖中发布! 3. 获得 $1 用于首次试用 SMM 面板:只需在我们网站(支持中心)提交一个主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和机器人中每周都会赠送 Telegram Stars! 当前链接: 数字商品商店(网站):前往 购买 Telegram Stars 的 Telegram 机器人:前往 SMM 面板:前往 – 推广您的社交媒体账号。 商店 Telegram 机器人:前往 新闻资源: Telegram 频道: https://t.me/accsforyou_shop WhatsApp 频道: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord 服务器: https://discord.gg/y9AStFFsrh 我们正在积极寻找以下商品类别的供应商: — Snapchat 新旧账号 | 带积分 (snapscores) | 地区: 欧洲/美国 | 邮箱/手机号完全访问权限 — Reddit 老账号(暴力破解或被盗来源,自注册)| 帖子和评论业力值 100 至 100,000+ | 含邮箱完全访问权限 — LinkedIn 老账号 | 拥有真实连接 (connections) | 地区: 欧洲/美国 | 邮箱完全访问权限 + 活跃的 2FA 密码 — Instagram 老账号 (2010-2023 年) | 邮箱完全访问权限(可能包含活跃的 2FA 密码) — Facebook 老账号 (2010-2023 年) | 邮箱完全访问权限(可能包含活跃的 2FA 密码)| 有好友或无好友 | 地区: 欧洲/美国/亚洲 — Threads 账号 | 邮箱完全访问权限(可能包含活跃的 2FA 密码) — TikTok/Facebook/Google ADS 代理广告账号 请通过以下联系方式联系我们 —— 我们来讨论合作条件! 我们也随时欢迎其他合作机会。 联系方式和支持: Telegram: https://t.me/socnet_support WhatsApp: https://wa.me/79051904467 Discord: socnet_support 邮箱: solomonbog@socnet.store 通过这些联系方式您还可以: — 咨询批量采购 — 建立合作伙伴关系(现有合作伙伴: https://socnet.bgng.io/partners ) — 成为我们的供应商
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock