Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Connection check mod request (http://www.bvlist.com/showthread.php?t=6644)

it53lv 28th June 2011 06:04

Connection check mod request
 
So i need a little function that checks if users pc is connectable
in case it is show one image and in other case another image

joeroberts 28th June 2011 06:20

PHP Code:

$sql "SELECT count(id) as count FROM ".$db_prefix."_peers WHERE connectable = 'yes' and uid = '".$userrow["id"]."';";
$conec $db->sql_query($sql) OR btsqlerror($sql);
$conectable $db->sql_fetchrow($conec);
if(
$conectable['count'] > 0)echo pic('icon_active.gif',NULL,'Conectable');
else
echo 
pic('icon_passive.gif',NULL,'Not Conectable'); 

should do it the images are in themes/theme/pics/

it53lv 28th June 2011 06:31

not working
this works better
Code:

$sql = "SELECT count(id) as count FROM ".$db_prefix."_peers WHERE connectable = 'yes' and uid = '".$user->id."';";
$conec = $db->sql_query($sql) OR btsqlerror($sql);
$conectable = $db->sql_fetchrow($conec);
if($conectable['count'] > 0)echo pic('/imperial/transmit_blue.png',NULL,'Conectable');
else
echo pic('/imperial/transmit.png',NULL,'Not Conectable');

changed get user id query

joeroberts 28th June 2011 06:32

that well show you I did it for putting in user profile
and you do not have to add theme link its part of the function you only put name of the pic

it53lv 28th June 2011 06:34

it needed to be a little diferent for me since there is a query for all the stuff already :bubble:
any hove good job :ok:

joeroberts 28th June 2011 06:38

please this
PHP Code:

echo pic('/imperial/transmit_blue.png',NULL,'Conectable'); 

needs to be like this
PHP Code:

echo pic('transmit_blue.png',NULL,'Conectable'); 

no need to add the theme and you put the image in the pics folder
the function auto maticly goes to themes/userstheme/pics/

it53lv 28th June 2011 06:42

i have all theme icons in themes/pmbt/pics/imperial/
these icons too
so i can later do cleanup and have only needed stuff

in this case puting new theme icons with old ones in same folder woud make a big mess
for me later

joeroberts 28th June 2011 06:44

but you posting like you did well confuse others that follow so Pointing it out to help

it53lv 28th June 2011 06:45

ok i'm sorry
i suggest better deleate all useles posts and leave only working code
and move topic to mod section


All times are GMT +2. The time now is 20:02.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.