Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2008, 04:10 PM
EuroPk EuroPk is offline
 
Join Date: Feb 2007
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How To Make a Plugin That would show up on the header

http://www.ihpk.net/last10pk.php



www.ihpk.net/forums.php


I'd want it to show up under the Our Last Victim


anyone know how to do this.
Reply With Quote
  #2  
Old 01-07-2008, 05:40 PM
EuroPk EuroPk is offline
 
Join Date: Feb 2007
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

COULD SOMEONE EXPLAINT O ME HOW I COULD TAKE


I'm basing this off another site.



www.bmpk.us/forums.php




[* Latest PK]


You Click it It Expands to This.





Now my site...

i've coded a hard copy of it www.ihpk.net/last10pk.php


I just dont know how i could make it , a plugin or w/e


if anyone can help me , let me know how i could do this , i'd appreicate it.

thanks..
Reply With Quote
  #3  
Old 01-07-2008, 07:07 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hook Location: global_start

You have to assign it to a variable like $lastvictim which you will use in the template.
Reply With Quote
  #4  
Old 01-07-2008, 07:31 PM
EuroPk EuroPk is offline
 
Join Date: Feb 2007
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow a response , amazed!!!! , ok but the question im asking , is how could i do that?
Reply With Quote
  #5  
Old 01-07-2008, 08:43 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=82625&highlight=plugin" target="_blank">Here is a tutorial on the plugin system.</a>

If you are just wanting to input static text somewhere in a page, I suggest using the template system.

In the plugin system you can't use output anything using echo, print, etc.. You must assign the text to a variable like $lastvictim, then use the variable in a template to output the text from the plugin.
Reply With Quote
  #6  
Old 01-07-2008, 10:49 PM
EuroPk EuroPk is offline
 
Join Date: Feb 2007
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow thanks for the help MoT , hopefully this might help figure it out... as of right now you are the only decent person i've seen on this forum... patheic , i dont know the lingo like the others here do , but you took the time to help me , thanks man.

--------------- Added [DATE]1199784513[/DATE] at [TIME]1199784513[/TIME] ---------------

can you define how i could take this code.. and make it a variable in that case?
<html>

<head>

<title>Latest 10 PK's BY IHPK</title>



<script type="text/javascript">

<!--

function toggleMenu(id)

{

menu = document.getElementById(id);

if ( menu.style.display && menu.style.display != 'none' )

{

menu.style.display = 'none';

}

else

{

menu.style.display = 'block';

}

}

-->

</script>

<style type="text/css">

body

{

background: #242424;

color: #999999;

font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;

margin: 0px;

padding: 0px;

}



.thead

{

background: #050505;

color: #2E2D2D;

font: bold 10px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;

}

.thead a:link, .thead_alink

{

color: #2E2D2D;

text-decoration: none;

}

.thead a:visited, .thead_avisited

{

color: #2E2D2D;

text-decoration: none;

}

.thead a:hover, .thead a:active, .thead_ahover

{

color: #2E2D2D;

text-decoration: underline;

}





#top10pk {

display: none;

background: #000000;

color: #ffffff;

padding: 0px;

margin: 0px;

border: 1px dashed #ff0000;

}



.alt1, .alt1Active

{

background: #131313;

border: 1px solid #000000;

border-top-width: 0px; border-left-width: 0px;

}

</style>

</head>

<body>



<div align="center">

<span onClick="toggleMenu('top10pk')">*Latest 10 PK's</span>

<div id="top10pk">

<?

function GetMemberUsergroupId($forumname) {

$SelectString = sprintf("SELECT * FROM user WHERE username = '%s'",$forumname);

$fetch_result = mysql_query($SelectString);

if($fetch = mysql_fetch_array ( $fetch_result ))

return $fetch['usergroupid'];

return '0';

}



function GetMemberTagByName($forumname) {

$UserGroupID=GetMemberUsergroupId($forumname);

if($UserGroupID==0)

return '<font color=gray>';

$SelectString = "SELECT * FROM usergroup WHERE usergroupid = ".$UserGroupID;

$fetch_result = mysql_query($SelectString);

if($fetch = mysql_fetch_array ( $fetch_result))

return $fetch['opentag'];



return '<font color=gray>';

}



// Getting Vars

$i = $_GET[ 'page'];

if(!is_numeric ($i))

$i= 0;

if($i!=0 ) {

$x = ($i -1) * 60;

$page = ($i-1) * 60;

}

else {

$x = $i * 60;

$page = $i *60 ;

}



if(isset($_GET['order' ]))

if($_GET['order'] == 'ASC')

$order = 'ASC';

else $order = 'DESC';



if(isset($_GET[ 'realm']))

if($_GET[ 'realm'] == 'USWest' || $_GET ['realm'] == 'USEast' || $_GET['realm'] == 'Europe' )

$realm = mysql_real_escape_string ($_GET['realm']);



if(isset($_GET['viewname' ]))

$viewname = mysql_real_escape_string( $_GET['viewname']);



if(isset( $_GET['sort']))

{

if( $_GET['sort'] == 'time' )

$sort = 'time' ;

else if($_GET['sort' ] == 'level')

$sort = 'o_level';

else if($_GET ['sort'] == 'name' )

$sort = 'o_name' ;

else if($_GET['sort'] == 'type')

$sort = 'o_typ';

else if($_GET[ 'sort'] == 'killer')

$sort = 'killer';

else if( $_GET['sort'] == 'realm' )

$sort = 'realm' ;

else if ($_GET['sort'] == 'points')

$sort = 'Points';

}



// build navbar

$navbits = array('' => $vbphrase[ 'PKLog']);

$templatename = 'PKLog';

// Connecting to MYSQL Database

mysql_connect('localhost','ihpk_xx','xx');

mysql_select_db('ihpk_xxx');

//mysql_real_escape_string



// Generating Select String

$SelectString = "Select * FROM pklog "; // Base string

if(isset( $viewname))

$SelectString = $SelectString . sprintf( " WHERE killer='%s' ", $viewname);

if(isset( $realm) && isset($viewname ))

$SelectString = $SelectString . sprintf(" AND realm='%s' ", $realm );

else if(isset($realm))

$SelectString = $SelectString . sprintf(" WHERE realm='%s' ", $realm );



if(isset($sort))

$SelectString = $SelectString . sprintf(" ORDER BY %s", $sort );

else

$SelectString = $SelectString . sprintf(" ORDER BY id" );



if(isset($order))

$SelectString = $SelectString . " " . $order. " ";

else

$SelectString = $SelectString . " DESC";



// The End

$SelectString = $SelectString . sprintf (" LIMIT ".$page. ",10");

/*

if(isset($_GET['viewname']))

$SelectString = sprintf("SELECT * FROM pklog WHERE killer='%s' ORDER by id ".$order."" LIMIT ".$page.",60" , mysql_real_escape_string($_GET['viewname']));

else

$SelectString = sprintf("SELECT * FROM pklog ORDER by id ".$order." LIMIT ".$page.",60");

*/

$pklog_result = mysql_query($SelectString ) or die ("A database error occured: " . mysql_error ());



function TotalPKs()

{

if(isset($_GET ['realm']))

if($_GET ['realm'] == 'USWest' || $_GET['realm'] == 'USEast' || $_GET['realm'] == 'Europe')

$realm = mysql_real_escape_string($_GET['realm' ]);



if(isset($_GET['viewname' ]))

$viewname = mysql_real_escape_string ($_GET['viewname' ]);



// Generating Select String

$SelectString = "Select * FROM pklog "; // Base string

if(isset($viewname))

$SelectString = $SelectString . sprintf( " WHERE killer='%s' ", $viewname);

if(isset( $realm) && isset($viewname ))

$SelectString = $SelectString . sprintf(" AND realm='%s' ", $realm );

else if(isset($realm))

$SelectString = $SelectString . sprintf(" WHERE realm='%s' ", $realm );



$pkliste_result = mysql_query ($SelectString);

$i =0;

while ( $pkliste = mysql_fetch_array ( $pkliste_result ) )

$i++;

return $i ;

}



if(!isset($_GET[ 'order']))

$dorder = 'DESC';

else if( $_GET['order'] == 'DESC' )

$dorder = 'ASC' ;

else if ($_GET['order'] == 'ASC')

$dorder = 'DESC';

else

$dorder = 'DESC';



// Building Table

echo '<table class="tborder" border="0" width="100%" align="center">

<tr align="center">

<td class="thead">#</td>

<td class="thead">Time</td>

<td class="thead">Victim</td>

<td class="thead">Class</td>

<td class="thead">Level</td>

<td class="thead">Killing Account</td>

<td class="thead">Game Type</td>

<td class="thead">PK Points</td>

<td class="thead">Realm</td>

</tr>';







while ( $pkliste = mysql_fetch_array($pklog_result) ) {

if($alt==2)

$alt=1;

else $alt=2;

$x++;

$killer = GetMemberTagByName($pkliste['killer' ]) . $pkliste['killer'] . "</font>";

// String which will be shown on teh template ^^

echo '<tr>



<td align="center" class="alt">'.$x.'</td>

<td align="center" class="alt">'.$pkliste['zeit' ].'</td>

<td align="center" class="alt">'.$pkliste['o_name'].'</td>

<td align="center" class="alt">'.$pkliste['o_typ' ].'</td>

<td align="center" class="alt">Level '.$pkliste['o_level'].'</td>

<td align="center" class="alt"><a href=pklog.php?viewname='.$pkliste[ 'killer'].'>'.$killer.'</a></td>

<td align="center" class="alt">'.$pkliste['Gametype'].'</td>

<td align="center" class="alt">'.$pkliste[ 'Points'].'</td>

<td align="center" class="alt">'.$pkliste['realm'].'</td>



</tr>';



}

?>

</table>

</div>

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03837 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete