TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 08:52:53 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 139
  • Total: 139

TP and phpraider block

Started by RebelRose, June 05, 2007, 01:57:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rebelrose

Can anyone tell me how to pull the infofrom the database and show them in a block, the info needed is from phpraider which is installed in the database.

Wanting to show upcoming raids etc.

something like this:

06/04 - 6:30pm(CST): Raid info  (IN PROGRESS)
06/06 - 6:30pm(CST): Raid info 
06/07 - 6:30pm(CST): Raid info 

stormlrd

is it part of the smf database? as in a mod or something. need to setup some globals and do a sql call for what you want basically.

rebelrose

Quote from: StormLrdâ„¢ on June 05, 2007, 02:05:36 AM
is it part of the smf database? as in a mod or something. need to setup some globals and do a sql call for what you want basically.

I don't know how to do that Storm :-\

stormlrd

do you have some kind of code somewhere for this? i need a point to start hun lmao.

rebelrose

This came from a site using Mkportal, but does what we need I just don't know how to put it in TP.


<?php

$rootlink 
"http://www.nethergard.com/phpraider/index.php?option=com_view&id";

function 
newDate$format$timestamp$tz ) {
$offset = (60 60) * ($tz 100); // Seconds from GMT
    
$timestamp $timestamp $offset;
    return 
gmdate$format$timestamp );
}

if (!
defined("IN_MKP")) {
    die (
"Sorry !! You cannot access this file directly.");
}
$content "";
$pConfig_timezone = -500;
$offset = (60 60) * ($pConfig_timezone/100);
$time_buffer = (60 60) * 2;  
$rightnow time() + $offset;
$future $rightnow $time_buffer;


//$DB->query("DELETE FROM mkp_chat WHERE run_time < ".$dead_users." ");
$DB->query("SELECT raid_id, location, start_time, raid_leader FROM phpraider_raid WHERE start_time > ".$future." ORDER BY start_time ASC ");

$sep ",";
$totalraids $DB->get_num_rows();


while ($raids $DB->fetch_row()) {
$year newDate"Y"$raids['start_time'], $pConfig_timezone);
$month newDate"m"$raids['start_time'], $pConfig_timezone );
$day newDate"d"$raids['start_time'], $pConfig_timezone );
$today_month newDate"m"time(), $pConfig_timezone );
$today_day newDate"d"time(), $pConfig_timezone );
$today "";
$timedone $raids['start_time'] + $time_buffer;
$hour gmdate"H"$raids['start_time'] );
$suffix="";
if($hour 12){
$hour $hour 12;
$suffix "pm";
}else {
$suffix "am";
}
$mins gmdate"i"$raids['start_time'] );
$hour2 gmdate"H:i"$rightnow );
$hour3 gmdate"H:i"$timedone );
//echo "{$hour} {$hour2} {$hour3} -";
if( $today_month == $month && $today_day == $day && 
    $raids['start_time'] < $rightnow && $rightnow $timedone) {
$today "     <span style='color:blue'><blink>(IN PROGRESS)</blink></span>";
} elseif( $today_month == $month && $today_day == $day ) {
$today "     <span style='color:green'><blink>(TODAY)</blink></span>";
}
$link ="<span style='color:yellow'> {$month}/{$day} - <a class=\"sg\" href=\"$rootlink={$raids['raid_id']}\">{$hour}:{$mins}{$suffix}(CST): {$raids['location']}</a>{$today}</span><br>";

   
$activeu .= $link." ";
}
if ( $totalraids ==  0){
$activeu "No upcoming raids.   ";
}
$activeu substr($activeu0, (strlen($activeu) -2));
$content "
<tr>
  <td width=\"100%\">
    <table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"1\">
      <tr>
<td class=\"tdblock\">
<span class=\"mktxtcontr\">
$totalraids</span> <b>Raid(s)</b>
</td>
      </tr>
      <tr>
<td class=\"tdglobal\">
$activeu
</td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td class=\"tdblock\">
  <img src=\"
$this->images/atb_chat.gif\" style=\"vertical-align: middle;\" alt=\"\" />&nbsp;<a class=\"uno\" href=\"http://www.nethergard.com/phpraider/index.php\">Raid Calendar</a>
  </td>
</tr>            
        "
;


unset($totalraids);
unset($rootlink);
unset($rightnow);

?>


stormlrd

//$DB->query("DELETE FROM mkp_chat WHERE run_time < ".$dead_users." ");
$DB->query("SELECT raid_id, location, start_time, raid_leader FROM phpraider_raid WHERE start_time > ".$future." ORDER BY start_time ASC ");


this part here, have you created this in your database and if so what parameters?

rebelrose

I am sorry, that part is not needed.  ???

stormlrd

than how are you storing the data?

rebelrose

#8
The data is stored in the smf database. I don't think anything special was done.

stormlrd

its cool, if you give me the database parameters will fix ya up.