Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.216
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ? This s...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriously...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Need help with a block
Need help with a block

6 Replies / 953 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » Blocks

View previous topic :: View next topic


DoC
Reputation: 89.6 Add RepSubtract Rep
votes: 5
Local time: 8:04 PM
Location: UK
uk.gif



0.20 posts per day
Medals: 3 (View more...)
Site Supporter (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 394
Points: 4451 

Post Need help with a block Posted: Fri Apr 24, 2009 8:56 am

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

Hey Guys,

I need some help with a Nuke block that has to connect to a different database than the one Nuke uses...

I have attached the block to this post and was wondering if a Guru would be able to help me out with it?

I have everything sorted as regards the layout but for the life of me I just cant seem to get it to connect to the KIllboard database Dont Know

DoC Pint

block-lastkills.rar
 Description:
The Block File Is In The .RAR

Download
 Filename:  block-lastkills.rar
 Filesize:  1.63 KB
 Downloaded:  6 Time(s)

 

 
View user's profileSend private messageSend e-mail Reply with quote

DoC
Reputation: 89.6 Add RepSubtract Rep
votes: 5
Local time: 8:04 PM
Location: UK
uk.gif



0.20 posts per day
Medals: 3 (View more...)
Site Supporter (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 394
Points: 4451 

Post Need help with a block Posted: Fri Apr 24, 2009 2:54 pm

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

KK as no one has looked at the download the code is below:

Code:

<?php
if ( !defined('BLOCK_FILE') ) { Header("Location: ../index.php"); die(); }

global $db, $prefix, $admin, $admin_file;

//Block Opts
$module_name = '20 Last Kills';
$killboard_database = 'KB DB ADDRESS HERE'; //Killboard Database Address
$killboard_user = 'DB USERNAME'; // Killboard Database Username
$killboard_password = 'DB PASSWORD'; // Killboard Database Password
$killboard_url = 'http://killboard.mass-alliance.net/?a=kill_detail&kll_id=';
$corpID = 0;
$allianceID = 0;
$maxKills = 20;


//Start Scroll
#$content = "<marquee behavior='scroll' height=200 direction='up' scrollamount='2' scrolldelay='10' onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= '<table class="kb-table"  align="center" cellspacing="1" border=1>
    <tr class="kb-table-header">
    <td class="kb-table-header" align="center">No.</td>
    <td class="kb-table-header" colspan="2" align="center">Ship type</td>
    <td class="kb-table-header" colspan="3" align="center">Victim</td>
    <td class="kb-table-header" colspan="2" align="center">Final blow</td>
    <td class="kb-table-header" align="center">System</td>
    <td class="kb-table-header" align="center">Time</td>
    </tr>';


//Last Kills
$sql = "SELECT distinct kll_id, kll_timestamp FROM `".$killboard_database."`.kb3_kills kll
   INNER JOIN `".$killboard_database."`.kb3_inv_crp inc
       ON inc.inc_kll_id = kll.kll_id
   INNER JOIN `".$killboard_database."`.kb3_inv_all ina
       ON ina.ina_kll_id = kll.kll_id";
      
if ($allianceID > 0){
    $sql .= " WHERE ina.ina_all_id = ".$allianceID;
}
if($corpID > 0){
    $sql .= " WHERE inc.inc_crp_id = ".$corpID;
}
$sql .= " GROUP BY kll_id ORDER BY kll_timestamp desc limit 0, ".$maxKills.";";
$result = $db->sql_query($sql);
                                                                
while($row = $db->sql_fetchrow($result)){
    $content .= buildKillRow($row[0],$row['kll_timestamp'],$killboard_database,$killboard_url);
}

$content .= "</table>";
#$content .= "</marquee>";

function buildKillRow($killID,$time,$killboard_database,$killboard_url){       
    global $db, $prefix, $admin, $admin_file;

    // ship and shipclass
    $sql2 = "select shp_name, shp_externalid , scl_class FROM `".$killboard_database."`.kb3_ships
      join `".$killboard_database."`.kb3_ship_classes
          on shp_class =  scl_id
      where shp_id = (select kll.kll_ship_id from `".$killboard_database."`.kb3_kills kll  where kll_id = ".$killID.")";
    if (mysql_error()) return mysql_error();
    $result2 = $db->sql_query($sql2);
    $row2 = $db->sql_fetchrow($result2);   

    // victim / corp / alliance
    $sql3 = "select plt_name, crp_name , all_name, plt_externalid FROM `".$killboard_database."`.kb3_kills
      join `".$killboard_database."`.kb3_pilots
          on plt_id = kll_victim_id
      join `".$killboard_database."`.kb3_corps
          on crp_id = plt_crp_id   
      join `".$killboard_database."`.kb3_alliances
          on all_id = crp_all_id   
           where kll_id = ".$killID;
    if (mysql_error()) return mysql_error();
    $result3 = $db->sql_query($sql3);
    $row3 = $db->sql_fetchrow($result3);   
    $allimage = $row3[2];
    if ($row3[2] != 'None'){
   $allimage = preg_replace('/[^a-zA-Z0-9]/', '', $allimage);
       $allimage = '<img height=32 width=32 src="http://www.eve-kill.net/img/alliances/'.$allimage.'.png">';
    }else{
   $allimage = " ";   
    }
   
   
    //final_blow
    $sql4 = "select plt_name, crp_name , all_name, plt_externalid FROM `".$killboard_database."`.kb3_kills
      join `".$killboard_database."`.kb3_pilots
          on plt_id = kll_fb_plt_id
      join `".$killboard_database."`.kb3_corps
          on crp_id = kll_fb_crp_id   
      join `".$killboard_database."`.kb3_alliances
          on all_id = kll_fb_all_id   
           where kll_id = ".$killID;
    if (mysql_error()) return mysql_error();
    $result4 = $db->sql_query($sql4);
    $row4 = $db->sql_fetchrow($result4);   
   
    //System
    $sql5 = "select sys_name, sys_sec FROM `".$killboard_database."`.kb3_kills
      join `".$killboard_database."`.kb3_systems
          on sys_id = kll_system_id   
           where kll_id = ".$killID;
    if (mysql_error()) return mysql_error();
    $result5 = $db->sql_query($sql5);
    $row5 = $db->sql_fetchrow($result5);          
   
    return "<tr><td><a href=".$killboard_url.$killID.">#$killID</a></td>
      <td width='32'><img src='http://www.go-pdi.com/edk/img/ships/32_32/".$row2[1].".png'></td>
      <td><b>".$row2[0]."</b><br>".$row2[2]."</td>
      <td><img src='http://www.eve-kill.net/?a=thumb&id=".$row3[3]."&size=32'></td><td><b>".$row3[0]."</b><br>".$row3[1]."</td><td>".$allimage."</td>
      <td><img src='http://www.eve-kill.net/?a=thumb&id=".$row4[3]."&size=32'></td><td><b>".$row4[0]."</b><br>".$row4[1]."</td>
      <td>".$row5[0]."(".number_format($row5[1],2).")</td>
      <td>$time</td>
       </tr>";
}
?>


Cheers

DoC Pint
 

 
View user's profileSend private messageSend e-mail Reply with quote

DoC
Reputation: 89.6 Add RepSubtract Rep
votes: 5
Local time: 8:04 PM
Location: UK
uk.gif



0.20 posts per day
Medals: 3 (View more...)
Dedication (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 394
Points: 4451 

Post Re: Need help with a block Posted: Sat Apr 25, 2009 7:22 pm

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

Right OK I have done the options to add the Killboard Database password & the user but where do I put in the code that information so the block will connect to it??

Help! I'm Confused.com Sarcastic Confused Sarcastic

DoC Pint
 

 
View user's profileSend private messageSend e-mail Reply with quote


Ped
Reputation: 94 Add RepSubtract Rep
votes: 37
Local time: 9:04 PM
Location: Great British Empire
uk.gif

Site Founder
Site Founder

1.82 posts per day
Medals: 2 (View more...)
Forums MoD (Amount: 1)
Theme Guru
Theme Guru
Joined: Nov 13, 2006
Last Visit: 25 May 2012
Posts: 3675
Points: 191987 

Post Re: Need help with a block Posted: Sat Apr 25, 2009 7:42 pm

Shop Purchases:
Clan Roster 2.0 · Bad Company 2 Vietnam Xtreme Theme

Bit over my head m8 Kiss
 

 
View user's profileSend private messageSend e-mail Reply with quote

DoC
Reputation: 89.6 Add RepSubtract Rep
votes: 5
Local time: 8:04 PM
Location: UK
uk.gif



0.20 posts per day
Medals: 3 (View more...)
Site Supporter (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 394
Points: 4451 

Post Re: Need help with a block Posted: Sat Apr 25, 2009 9:40 pm

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

Cracked it LOL just had to put the connect and close feels stupid and need to wake up my bad, been long week Zipped

Code:

mysql_connect(localhost,$kb_username,$kb_password);
@mysql_select_db($kb_database) or die( "Unable to select database");
mysql_close();


Was needed under the database line, noted pad++ is great, was shown by dreads tutorials they awesome man :P

Although I need to work on some of the layout of it as it has spread the center block completly across need to get used to tables now lol

Have fun

DoC Pint
 

 
View user's profileSend private messageSend e-mail Reply with quote

Ped
Reputation: 94 Add RepSubtract Rep
votes: 37
Local time: 9:04 PM
Location: Great British Empire
uk.gif

Site Founder
Site Founder

1.82 posts per day
Medals: 2 (View more...)
Super Dedicated User (Amount: 1)
Theme Guru
Theme Guru
Joined: Nov 13, 2006
Last Visit: 25 May 2012
Posts: 3675
Points: 191987 

Post Re: Need help with a block Posted: Sat Apr 25, 2009 9:47 pm

Shop Purchases:
Clan Roster 2.0 · Bad Company 2 Vietnam Xtreme Theme

Yeah i use notepad++ in place of the standard notepad.

WHat does that block do anyway ?
 

 
View user's profileSend private messageSend e-mail Reply with quote


DoC
Reputation: 89.6 Add RepSubtract Rep
votes: 5
Local time: 8:04 PM
Location: UK
uk.gif



0.20 posts per day
Medals: 3 (View more...)
Site Supporter (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 394
Points: 4451 

Post Re: Need help with a block Posted: Mon Apr 27, 2009 11:42 am

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

It connects the EVE Dev Killboard database and displays the last 20 kills made. It then displays the victim and the killer but has not really been designed to fit in a center block. However it does work so now it's just cosmetics to sort and once that is done I shall upload the block for others that play EVE Online & have a Nuke site with a Killboard.

I am also thinking about making this into a module as well so last 20 kills and 20 losses can be viewed in the module as well as the top 20 killers / lossers... Lot's to do with no time to do it in LOL

DoC Pint
 

 
View user's profileSend private messageSend e-mail Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » Blocks


 
6 Replies / 953 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum