/
my_networks.php
58 lines (52 loc) · 2.3 KB
/
my_networks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/******************************************************************************
Etano
===============================================================================
File: my_networks.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require 'includes/common.inc.php';
require _BASEPATH_.'/includes/user_functions.inc.php';
require _BASEPATH_.'/includes/network_functions.inc.php';
require _BASEPATH_.'/skins_site/'.get_my_skin().'/lang/net.inc.php';
check_login_member('manage_networks');
$tpl=new phemplate(_BASEPATH_.'/skins_site/'.get_my_skin().'/','remove_nonjs');
require _BASEPATH_.'/includes/classes/user_cache.class.php';
$user_cache=new user_cache(get_my_skin());
$query="SELECT `net_id`,`network` FROM `{$dbtable_prefix}networks`";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
$networks=array();
$i=0;
while ($rsrow=mysql_fetch_assoc($res)) {
$rsrow['network']=sanitize_and_format($rsrow['network'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);
$net_members=get_network_members($_SESSION[_LICENSE_KEY_]['user']['user_id'],$rsrow['net_id'],4);
if (!empty($net_members)) {
$rsrow['members']=$user_cache->get_cache_tpl($net_members,'result_user');
}
if (!empty($rsrow['members'])) {
$rsrow['see_all']=true;
$networks[]=$rsrow;
}
}
$output=array();
$output['user_id']=$_SESSION[_LICENSE_KEY_]['user']['user_id'];
$tpl->set_file('content','my_networks.html');
$tpl->set_var('output',$output);
$tpl->set_loop('networks',$networks);
$tpl->process('content','content',TPL_MULTILOOP | TPL_OPTLOOP | TPL_NOLOOP);
$tpl->drop_loop('networks');
unset($networks);
$tplvars['title']=$GLOBALS['_lang'][240];
$tplvars['page_title']=$GLOBALS['_lang'][240];
$tplvars['page']='my_networks';
$tplvars['css']='my_networks.css';
if (is_file('my_networks_left.php')) {
include 'my_networks_left.php';
}
unset($page_last_modified_time); // we want everything fresh on this page.
include 'frame.php';