d319e18c44d4e9154df7b39db525c774ab935eca
[atutor.git] / mods / plog / index_admin.php
1 <?php\r
2 /*\r
3 This is the ATutor admin plog module page. It allows an admin user\r
4 to access all blog admin features through the default blog created\r
5 when LifeType/pLog was installed.\r
6 */\r
7 define('AT_INCLUDE_PATH', '../../include/');\r
8 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
9 \r
10 //////////\r
11 //Check to see if the url to plog exists in the db \r
12 $sql = 'SELECT * from '.TABLE_PREFIX.'config WHERE name="plog"';\r
13 $result = mysql_query($sql, $db);\r
14 while($row = mysql_fetch_array($result)){\r
15         $plog_url_db = $row[1];\r
16 }\r
17 if($plog_url_db == ''){\r
18 \r
19         $msg->addInfo('PLOG_URL_ADD_REQUIRED');\r
20         require (AT_INCLUDE_PATH.'header.inc.php');\r
21         require (AT_INCLUDE_PATH.'footer.inc.php');\r
22 \r
23 }else{\r
24 \r
25         require (AT_INCLUDE_PATH.'header.inc.php');\r
26         $sql="SELECT *  FROM ".TABLE_PREFIX."admins WHERE login='$_SESSION[login]'";\r
27         $result = mysql_query($sql, $db);\r
28         \r
29         while($row = mysql_fetch_array($result)){\r
30                 $pw =  $row[1];\r
31         }\r
32         \r
33         ?>\r
34         <iframe name="plog" id="plog" title="pLog" scrolling="yes" src="<?php echo $plog_url_db; ?>summary.php" height="800" width="90%" align="center" style="border:thin white solid; align:center;"></iframe>\r
35         <?php \r
36         \r
37         \r
38         require (AT_INCLUDE_PATH.'footer.inc.php'); \r
39 \r
40 }?>