Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
Thread Tools
  #1  
Old 28th June 2011, 06:04
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default 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
Reply With Quote
  #2  
Old 28th June 2011, 06:20
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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/
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 28th June 2011, 06:31
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
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
Reply With Quote
  #4  
Old 28th June 2011, 06:32
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 28th June 2011, 06:34
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
it needed to be a little diferent for me since there is a query for all the stuff already :bubble:
any hove good job
Reply With Quote
  #6  
Old 28th June 2011, 06:38
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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/
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #7  
Old 28th June 2011, 06:42
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
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
Reply With Quote
  #8  
Old 28th June 2011, 06:44
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
but you posting like you did well confuse others that follow so Pointing it out to help
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #9  
Old 28th June 2011, 06:45
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
ok i'm sorry
i suggest better deleate all useles posts and leave only working code
and move topic to mod section
Reply With Quote
Reply

Tags
check , connection , mod , request


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 +2. The time now is 04:57. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.