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

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 05:44:44 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 59
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 48
  • Total: 49
  • @rjen

Variation of WoW recruitment block

Started by Umiya, October 07, 2012, 09:45:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Umiya

Hello all!

I am by no means the best with php and am in need of some help. I have modified the wow recruitment block for SWTOR but it doesn't work. I just did some simple edits with my class names and specs, figured it would work out but no so much. Please take a look at tell me where I screwed up! Thanks.

//**********TP: WOW RECRUITMENT BLOCK BY wareZ[xv]**************
//Version 2.0                                                  *
//                                                             *
//Requires wz_tooltip on your server inside folder "wz_tooltip"*
//in your forum directory.                                     *
//wz_tooltip can be found at:                                  *
//http://www.walterzorn.de/tooltip/tooltip_e.htm               *
//                                                             *
//Enjoy. Modify the code as you see fit.                       *
//**************************************************************

global $user_info;

//*******************CONFIGURATION SECTION*********************

//--Individual Class Need Rating--//
//Place the need for each class to the right of the equals sign.
//0 = closed
//1 = low
//2 = med
//3 = high
//4 = open (just in case people still like the open/closed wording)

$assasin_need = 2;
$sorcerer_need = 2;
$marauder_need = 2;
$juggernaut_need = 2;
$operative_need = 2;
$sniper_need = 2;
$powertech_need = 2;
$mercernary_need = 2;

//--Quantity needed of each spec!--//
//To the right of the = sign, type the # you need of that spec!
//Here you can be much more specific than simply "High," "Medium," or "Low."

//Warrior
$tank_jug = 0;
$dps_jug = 0;
$dps_mar = 0;

//Inquisitor
$tank_ass = 0;
$dps_ass = 0;
$heal_sorc = 0;
$dps_sorc = 0;

//Imperial Agent
$dps_sniper = 0;
$dps_oper= 0;
$heal_oper = 0;

//Bounty Hunter
$dps_power = 0;
$tank_power= 0;
$dps_merc = 0;
$heal_merc = 0;

//--COLORS--//
/*
$closed_color = 'red';
$low_color = 'green';
$medium_color = 'orange';
$high_color = 'red';
$open_color = 'green';
*/

//--LOCALIZATION--//
//LANGUAGE VARIABLES FOR EACH SPEC

//Warrior
$tankjug_spec = 'Tank Juggernaut:';
$dpsjug_spec = 'Dps Juggernaut:';
$dpsmar_spec = 'Dps Marauder:';

//Inquisitor
$tankass_spec = 'Tank Assassian:';
$dpsass_spec = 'Dps Assassian:';
$healsorc_spec = 'Heal Sorcerer:';
$dpssorc_spec = 'Dps Sorcerer:';

//Imperial Agent
$dpssniper_spec  = 'Sniper:';
$dpsoperative_spec = 'Dps Operative:';
$healoperative_spec = 'Heal Operative:';

//Bounty Hunter
$dpspower_spec  = 'Dps Powertech:';
$tankpower_spec = 'Tank Powertech:';
$healmerc_spec = 'Heal Mercernary:';
$dpsmerc_spec = 'Dps Mercernary:';

//************************END CONFIG****************************

//*************************FUCNTIONS****************************

function printClassStatus($className)
{
switch($className)
{
case 0: return '<font color="red">Closed</font>';
case 1: return '<font color="green">Low</font>';
case 2: return '<font color="orange">Medium</font>';
case 3: return '<font color="red">High</font>';
case 4: return '<font color="green">Open</font>';
}
}
function displayTT($class="",$specName1="",$spec1="",$specName2="",$spec2="",$specName3="",$spec3="",$specName4="",$spec4="")
{
return '
<a href="javascript:void(0);" onmouseover="Tip(\'<table width=100%><tr><td><font color=black>' .$specName1 .  '</font></td><td><font color=black>' . $spec1 . '</font></td></tr><tr><td><font color=black>' . $specName2 . '</font></td><td><font color=black>' . $spec2 . '</font></td></tr><tr><td><font color=black>' . $specName3 . '</font></td><td><font color=black>' . $spec3 . '</font></td></tr><tr><td><font color=black>' . $specName4 . '</font></td><td><font color=black>' . $spec4 . '</font></td></tr></table>\')" onmouseout="UnTip()">' . printClassStatus($class) . '</a>';
}
//**********************END FUNCTIONS****************************
echo'
<script type="text/javascript" src="./wz_tooltip/wz_tooltip.js"></script>
<center>Hover over the recruitment level for details</center>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/juggernaut.jpg" /><font color="#FFFFFF"><b>Juggernaut</b></font></td>
            <td valign="middle"><strong>' . displayTT($juggernaut_need,$tankjug_spec,$tank_jug ,$dpsjug_spec ,$tank_jug) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/marauder.jpg" /><font color="#FFFFFF"><b>Marauder</b></font></td>
            <td valign="middle"><strong>' . displayTT($marauder_need,$dpsmar_spec,$dps_mar) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/marauder.jpg" /><font color="#FFFFFF"><b>Assassian</b></font></td>
            <td valign="middle"><strong>' . displayTT($assasin_need,$dpsass_spec ,$dps_ass,$tankass_spec ,$tank_ass) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/sorcerer1.jpg" /><font color="#FFFFFF"><b>Sorcerer</b></font></td>
            <td valign="middle"><strong>' . displayTT($sorcerer_need,$healsorc_spec ,$heal_sorc,$dpssorc _spec ,$dps_sorc ) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/sniper.jpg" /><font color="#FFFFFF"><b>Sniper</b></font></td>
            <td valign="middle"><strong>' . displayTT($sniper_need ,$dpssniper _spec ,$dps_sniper) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/operative.jpg" /><font color="#FFFFFF"><b>Sniper</b></font></td>
            <td valign="middle"><strong>' . displayTT($operative_need,$dpsoper _spec ,$dps_oper,$healoper _spec ,$heal_oper) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/powertech.jpg" /><font color="#FFFFFF"><b>Powertech</b></font></td>
            <td valign="middle"><strong>' . displayTT($powertech_need,$dpspower_spec ,$dps_power,$tankpower_spec ,$tank_power) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/mercenary.jpg" /><font color="#FFFFFF"><b>Mercernary</b></font></td>
            <td valign="middle"><strong>' . displayTT($mercernary_need ,$dpsmerc_spec ,$dps_merc,$healmerc _spec ,$heal_merc) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
             <td><center><i>Exceptional applicants of any class will be considered.</center></i>
             </td>
        </tr>
        <tr>';
if($user_info['is_guest'])
{
echo'
            <td><br />
            <div align="center"><a href="/forum/index.php?action=register">Please Register before Applying</a><br />
            </div>
            </td>';
}
else
{
echo'

            <td> <br />
            <div align="center"><a href="/forum/index.php?page=3">Apply Here</a><br />
            </div>
            </td>';
}
echo'
        </tr>
    </tbody>
</table>
</font>
';

IchBin

perhaps you could provide some informatin about what "doesn't work" means... Any errors?

A link to the original code would help as well.

Umiya

http://www.tinyportal.net/index.php?topic=34999.0

This is the original code.

And when i put this  in a block, nothing returns. I don't know what the error is.

IchBin

The error if any would be shown in the SMF log, and possibly in your servers error_log that you should be able to get from your control panel on your host.

Assuming you put the javascript file and everything where they specified?

Umiya

Here is what is in my error log

Today at 04:55:48 PM
Apply Filter: Only show the error messages of this session 248908584ea4effba02c61bb714318c1
Apply Filter: Only show the errors of this type Type of error: Undefined


Apply Filter: Only show the error messages of this URL
http://www.always-wrong.com/index.php?
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URL
Apply Filter: Only show the errors from this file
File: /home1/alwaysw2/public_html/Sources/Subs.php
Line: 2948

IchBin

You have several errors in your code where you have typed the variable wrong. You have a space before some of the underscores in several places. Here's the code fixed up. You'll see these errors if you use a good editor that can show you PHP errors as you work on the page.

//**********TP: WOW RECRUITMENT BLOCK BY wareZ[xv]**************
//Version 2.0                                                  *
//                                                             *
//Requires wz_tooltip on your server inside folder "wz_tooltip"*
//in your forum directory.                                     *
//wz_tooltip can be found at:                                  *
//http://www.walterzorn.de/tooltip/tooltip_e.htm               *
//                                                             *
//Enjoy. Modify the code as you see fit.                       *
//**************************************************************

global $user_info;

//*******************CONFIGURATION SECTION*********************

//--Individual Class Need Rating--//
//Place the need for each class to the right of the equals sign.
//0 = closed
//1 = low
//2 = med
//3 = high
//4 = open (just in case people still like the open/closed wording)

$assasin_need = 2;
$sorcerer_need = 2;
$marauder_need = 2;
$juggernaut_need = 2;
$operative_need = 2;
$sniper_need = 2;
$powertech_need = 2;
$mercernary_need = 2;

//--Quantity needed of each spec!--//
//To the right of the = sign, type the # you need of that spec!
//Here you can be much more specific than simply "High," "Medium," or "Low."

//Warrior
$tank_jug = 0;
$dps_jug = 0;
$dps_mar = 0;

//Inquisitor
$tank_ass = 0;
$dps_ass = 0;
$heal_sorc = 0;
$dps_sorc = 0;

//Imperial Agent
$dps_sniper = 0;
$dps_oper= 0;
$heal_oper = 0;

//Bounty Hunter
$dps_power = 0;
$tank_power= 0;
$dps_merc = 0;
$heal_merc = 0;

//--COLORS--//
/*
$closed_color = 'red';
$low_color = 'green';
$medium_color = 'orange';
$high_color = 'red';
$open_color = 'green';
*/

//--LOCALIZATION--//
//LANGUAGE VARIABLES FOR EACH SPEC

//Warrior
$tankjug_spec = 'Tank Juggernaut:';
$dpsjug_spec = 'Dps Juggernaut:';
$dpsmar_spec = 'Dps Marauder:';

//Inquisitor
$tankass_spec = 'Tank Assassian:';
$dpsass_spec = 'Dps Assassian:';
$healsorc_spec = 'Heal Sorcerer:';
$dpssorc_spec = 'Dps Sorcerer:';

//Imperial Agent
$dpssniper_spec  = 'Sniper:';
$dpsoperative_spec = 'Dps Operative:';
$healoperative_spec = 'Heal Operative:';

//Bounty Hunter
$dpspower_spec  = 'Dps Powertech:';
$tankpower_spec = 'Tank Powertech:';
$healmerc_spec = 'Heal Mercernary:';
$dpsmerc_spec = 'Dps Mercernary:';

//************************END CONFIG****************************

//*************************FUCNTIONS****************************

function printClassStatus($className)
{
switch($className)
{
case 0: return '<font color="red">Closed</font>';
case 1: return '<font color="green">Low</font>';
case 2: return '<font color="orange">Medium</font>';
case 3: return '<font color="red">High</font>';
case 4: return '<font color="green">Open</font>';
}
}
function displayTT($class="",$specName1="",$spec1="",$specName2="",$spec2="",$specName3="",$spec3="",$specName4="",$spec4="")
{
return '
<a href="javascript:void(0);" onmouseover="Tip(\'<table width=100%><tr><td><font color=black>' .$specName1 .  '</font></td><td><font color=black>' . $spec1 . '</font></td></tr><tr><td><font color=black>' . $specName2 . '</font></td><td><font color=black>' . $spec2 . '</font></td></tr><tr><td><font color=black>' . $specName3 . '</font></td><td><font color=black>' . $spec3 . '</font></td></tr><tr><td><font color=black>' . $specName4 . '</font></td><td><font color=black>' . $spec4 . '</font></td></tr></table>\')" onmouseout="UnTip()">' . printClassStatus($class) . '</a>';
}
//**********************END FUNCTIONS****************************
echo'
<script type="text/javascript" src="./wz_tooltip/wz_tooltip.js"></script>
<center>Hover over the recruitment level for details</center>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/juggernaut.jpg" /><font color="#FFFFFF"><b>Juggernaut</b></font></td>
            <td valign="middle"><strong>' . displayTT($juggernaut_need, $tankjug_spec, $tank_jug, $dpsjug_spec, $tank_jug) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/marauder.jpg" /><font color="#FFFFFF"><b>Marauder</b></font></td>
            <td valign="middle"><strong>' . displayTT($marauder_need, $dpsmar_spec, $dps_mar) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/marauder.jpg" /><font color="#FFFFFF"><b>Assassian</b></font></td>
            <td valign="middle"><strong>' . displayTT($assasin_need, $dpsass_spec, $dps_ass, $tankass_spec, $tank_ass) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/sorcerer1.jpg" /><font color="#FFFFFF"><b>Sorcerer</b></font></td>
            <td valign="middle"><strong>' . displayTT($sorcerer_need, $healsorc_spec, $heal_sorc, $dpssorc_spec, $dps_sorc ) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/sniper.jpg" /><font color="#FFFFFF"><b>Sniper</b></font></td>
            <td valign="middle"><strong>' . displayTT($sniper_need, $dpssniper_spec, $dps_sniper) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/operative.jpg" /><font color="#FFFFFF"><b>Sniper</b></font></td>
            <td valign="middle"><strong>' . displayTT($operative_need, $dpsoper_spec, $dps_oper, $healoper_spec, $heal_oper) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/powertech.jpg" /><font color="#FFFFFF"><b>Powertech</b></font></td>
            <td valign="middle"><strong>' . displayTT($powertech_need, $dpspower_spec, $dps_power, $tankpower_spec, $tank_power) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="70%"><img alt="" style="vertical-align:middle" src="classicons/mercenary.jpg" /><font color="#FFFFFF"><b>Mercernary</b></font></td>
            <td valign="middle"><strong>' . displayTT($mercernary_need, $dpsmerc_spec, $dps_merc, $healmerc_spec, $heal_merc) . '</strong></td>
            <td width="10%"> </td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
             <td><center><i>Exceptional applicants of any class will be considered.</center></i>
             </td>
        </tr>
        <tr>';
if($user_info['is_guest'])
{
echo'
            <td><br />
            <div align="center"><a href="/forum/index.php?action=register">Please Register before Applying</a><br />
            </div>
            </td>';
}
else
{
echo'

            <td> <br />
            <div align="center"><a href="/forum/index.php?page=3">Apply Here</a><br />
            </div>
            </td>';
}
echo'
        </tr>
    </tbody>
</table>';

Umiya

Appreciate it. I'v always used word pad, are there any good free php editors?

lurkalot

Notepad++ is great for editing files.  You'll be hard pushed to find many that don't use it.http://notepad-plus-plus.org/

Umiya

So I'v got it looking all good now, but one last thing I would love. How would I go about getting the mouse over effect on the images?

ZarPrime

Umiya,

Sadly, Walter Zorn, the coder for wztooltips, passed away in 2009.  However, it looks like he wrote the code for the event handlers in wztooltips to be able to handle html inside the tooltips so you may be able to get tooltips on the images.  He left some pretty good documentation about how to do this so I will refer you to that.  Here is a link for the docs --> http://www.walterzorn.de/en/tooltip/tooltip_e.htm

If you scroll down that page and look for # 6. HTML inside tooltips, it will explain how you can do that.

ZarPrime