Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kaip padaryti ikona prei zaidimo pavadinimo
Parašė bartascs· 2012 Bir. 18 12:06:29
#1
Sveiki, taigi pasidariau tokias kaip ir kategorijas serveriu :) na tiksliau zaidimu serverius, kuriu galima matyt online statistika ir kaip man padaryti pagal mano visa daryta varianta, kad prie serverio pavadinimo rodytu zaidimo
ikona?
stai taip koda rasiau :)))
susikuriau lentelej laukeli :))
ALTER TABLE amx_servers ADD server_game VARCHAR(30) NOT NULL DEFAULT 'otr';
i register.php faila pasirasiau toki koda:
echo "<tr>\n<td class='tbl1'>Pasirinkite zaidima:<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl1' style='text-align:right'>";
echo "<select name='gametype' style='width:206px'>";
echo "<option value='otr'>Visi zaidimai</option>";
echo "<option value='cs'>Counter Strike 1.6</option>";
echo "<option value='css'>Counter Strike Source</option>";
echo "<option value='cz'>Counter Strike CZ</option>";
echo "<option value='hl'>Half Life</option>";
echo "<option value='hl2dm'>Half Life 2 DM</option>";
echo "<option value='hl2zp'>Half Life 2 ZP</option>";
echo "<option value='gm'>Garry's Mod</option>";
echo "<option value='ff'>Fortress Forever</option>";
echo "<option value='tfc'>TeamFortress Classic</option>";
echo "<option value='tf2'>TeamFortress 2</option>";
echo "<option value='dod'>Day of Defeat</option>";
echo "<option value='dods'>Day of Defeat Source</option>";
echo "<option value='l4d'>Left 4 Dead</option>";
echo "<option value='l4d2'>Left 4 Dead 2</option>";
echo "</select></td></tr>";
ir t.t.t....
taigi man reikia, kad rodytu ikona prie zaidimo pavadinimo:
pvz: rasau koda:
if ($_GET['id'] == "all")
{
require "gametype/all.php";
}
elseif ($_GET['id'] == "cs")
{
require "gametype/cs.php";
}
elseif ($_GET['id'] == "css")
{
require "gametype/css.php";
}
elseif ($_GET['id'] == "cz")
{
require "gametype/cz.php";
}
elseif ($_GET['id'] == "hl")
{
require "gametype/hl.php";
}
elseif ($_GET['id'] == "hl2dm")
{
require "gametype/hl2dm.php";
}
elseif ($_GET['id'] == "hl2zp")
{
require "gametype/hl2zp.php";
}
elseif ($_GET['id'] == "dod")
{
require "gametype/dod.php";
}
elseif ($_GET['id'] == "dods")
{
require "gametype/dods.php";
}
elseif ($_GET['id'] == "ff")
{
require "gametype/ff.php";
}
elseif ($_GET['id'] == "gm")
{
require "gametype/gm.php";
}
elseif ($_GET['id'] == "tfc")
{
require "gametype/tfc.php";
}
elseif ($_GET['id'] == "tf2")
{
require "gametype/tf2.php";
}
elseif ($_GET['id'] == "l4d")
{
require "gametype/l4d.php";
}
elseif ($_GET['id'] == "l4d2")
{
require "gametype/l4d2.php";
}
elseif ($_GET['id'] == "otr")
{
require "gametype/otr.php";
}
taigi kaip galima pagal tai padaryti ikonus jei bus pvz:
css serveris ir rodys
css ikona prie pavadinimo :)))
cia si koda dariau, kad rodytu serverius pagal pasirinkima tai glaima ir pritaikyt su ikonais :))
ar pavyktu ?
as manu jei butu pasirinkts serveris ir su get metodu atvaizduojamas is
mysql uzrasas
css ir man prie pavadinimo bus paveiksliukas to zaidimo kieno uzrasa atvaizdavo :))
pvz: ar pavyktu?
elseif ($_GET['id'] == "css")
{
require "<img src='/images/icons/css.gif'>";
}
ar butu kitu variantu? :)))
Parašė Jaunelis· 2012 Bir. 18 13:06:22
#2
Pavykt pavyktų, arba tiesiog tuose failuose pvz:
cs.php prie pavadinimo pridėk tą paveiksliuko nuorodą ir viskas :) tačiau tavo variantas irgi geras.
Parašė minimukas· 2012 Bir. 18 15:06:27
#3
Jaunelis bet jei jis i kikviena faila prides paveiksliuko nuoroda jam terodys tik paveikslius kai pasirinks pagal kategorija, o pgr puslapyje kazin ar rodys :)) tai gal jau su if.... :)))
Parašė Faitas.· 2012 Bir. 18 15:06:58
#4
Variantas neblogas, tik yra viena problema, kad tu nekreipi dėmesio į kodo vykdymo greitį... Jei nori, kad tavo kodas veiktų greičiau, naudok switch-case sakinį.
If-elseif-else tikrina tą tavo kintamąjį tiek kartų, kol daeina TRUE, o switch-case tavo kintamojo reikšmę gaus tik 1 kartą, todėl kodo vykdymas ne tiek ir daug užims laiko.
Parašė minimukas· 2012 Bir. 18 15:06:01
#5
Cia daug variantu gali padaryt jisai :DDD
pvz dar :DD
<img src='images/icons/$k[laukelis].gif'>
:DDD irgi neblogai :DDD
Redagavo minimukas· 2012 Bir. 18 16:06:02
Parašė bartascs· 2012 Bir. 18 18:06:41
#6
Aciu uz pagalba, taigi turiu dar viena klausima, turiu pasirases koda kuris yra maincore.php faile
$settings = dbarray(dbquery("SELECT * FROM ".DB_SETTINGS));
$servers = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='cs' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$all = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$cs = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='cs' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$css = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='css' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$cz = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='cz' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$hl = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='hl' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$hl2dm = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='hl2dm' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$hl2zp = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='hl2zp' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$gm = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='gm' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$dod = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='dod' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$dods = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='dods' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$ff = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='ff' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$tfc = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='tfc' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$tf2 = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='tf2' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$l4d = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='l4d' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$l4d2 = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='l4d2' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
$otr = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='otr' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
pagrindinis dalykas yra toks kad sitoje eiluteje
$servers = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='cs' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
yra rodomas pagrindinime puslapyje esantys serveriai, kai bandau dar keist sia veita
taip
man nebepeta pagridniame puslapyje nei vieno serverio kai nekeiciu nieko man rodo tik cs serverius kur ica kladia yra bandziau cs,
css ... taip rasyt irgi nieko gal patartumete ka daryt, kad rodytu mano visus serverius?
Parašė Faitas.· 2012 Bir. 18 18:06:59
#7
Jei gerai supratau, tai tu nori padaryti, kad tau rodytų ne CS vien tik serverius, o visus, tai tu praplatink paiešką:
$servers = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_game='cs' and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
Šitą pakeisk į:
$servers = dbquery("SELECT * FROM ".DB_SERVERS . " where server_new != 1 and server_status != 0 and server_off != 1 order by server_vip desc, votes desc");
Redagavo Faitas.· 2012 Bir. 18 18:06:11