[phpMP-CVS] CVS: phpMP/modules simple_news.php,NONE,1.1 menu_side.php,1.3,1.4 user_side.php,1.6,1.7
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-04-11 05:40:18
|
Update of /cvsroot/phpmp/phpMP/modules In directory usw-pr-cvs1:/tmp/cvs-serv3388/modules Modified Files: menu_side.php user_side.php usercp.php Added Files: simple_news.php Log Message: Updated more DBA. Added Extremely Basic News module. --- NEW FILE: simple_news.php --- <?php $file = 'simple_news.php'; // should be set in some tupe of admin panel somewhere in the future $news[before] = '<table border="0" width="100%" cellspacing="0" cellpadding=0"><tr><td width="100%">'; $news[after] = '</td></tr><tr><td width="100%" height="1" bgcolor="#000000"></td></tr><tr><td width="100%" align="center"><small><small><i>posted by <b><a href="mailto:{user.email}">{user.name}</a></b> on <b>{post.date}</b></i></small></small>'.'</td></tr></table>'; class Module { function Init() { $this->pagetitle = "phpMP :: Latest News"; } function MakeContent() { global $Template, $DBA, $MPCONF, $news; if (strlen($news_db)==0) {$news_db='index';} $query = $DBA->query('SELECT title, body, date, user_id FROM '.$MPCONF['DB']['table_prefix'].'news WHERE news_db = \''.$news_db.'\' ORDER BY date DESC'.$x_query); $count = $DBA->affected_rows(); for($i = 0; $i < $count; $i++) { list($post[title], $post[body], $post[date], $post[user_id]) = $DBA->fetch_row($query); $trans=array( '{post.date}' => date('l, F j, Y - g:i A',$post[date]), '{user.name}' => $post[user_name], '{user.email}' => $post[user_email]); $news[0] = strtr($news[before], $trans); $news[1] = strtr($news[after], $trans); $Template->Blocking('BeginBig', array(PAGETITLE => $post[title])); echo nl2br($news[0].$post[body].$news[1]); $Template->Blocking('EndBig'); } } } $Module = new Module(); ?> Index: menu_side.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules/menu_side.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** menu_side.php 11 Apr 2002 04:15:39 -0000 1.3 --- menu_side.php 11 Apr 2002 05:40:15 -0000 1.4 *************** *** 12,17 **** $content .= $MPCONF['TPL']['bullet_html'] . ' <a href="' . $MPCONF['GEN']['uri'] . '/index.php">Home</a><br>' . "\n"; ! $result = $DBA->query("SELECT name,unixname FROM " . $MPCONF['DB']['table_prefix'] . "modules WHERE active='1'"); ! while($row = @mysql_fetch_array($result)) { $content .= makeLink($row['name'], $row['unixname']); } --- 12,17 ---- $content .= $MPCONF['TPL']['bullet_html'] . ' <a href="' . $MPCONF['GEN']['uri'] . '/index.php">Home</a><br>' . "\n"; ! $result = $DBA->query("SELECT name,unixname FROM " . $MPCONF['DB']['table_prefix'] . "modules WHERE active='1' ORDER BY name"); ! while($row = $DBA->fetch_array($result)) { $content .= makeLink($row['name'], $row['unixname']); } Index: user_side.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules/user_side.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** user_side.php 8 Apr 2002 22:29:14 -0000 1.6 --- user_side.php 11 Apr 2002 05:40:15 -0000 1.7 *************** *** 2,11 **** $identFile = "user_side.php"; ! global $PHP_SELF; if($MPCONF['USR']['username'] != "Anonymous") { $blockname = "Welcome"; ! $content = "<font size='1'>Welcome back,<br> " . $MPCONF['USR']['username'] . "!</font>"; } else { --- 2,17 ---- $identFile = "user_side.php"; ! global $PHP_SELF, $content; if($MPCONF['USR']['username'] != "Anonymous") { $blockname = "Welcome"; ! $content .= "<font size='1'>Welcome back,<br> " . $MPCONF['USR']['username'] . "!</font><br />"; ! $content .= "<br />"; ! $content .= "<font size='1'><a href='" . $MPCONF['GEN']['uri'] . "/members/profile.php?action=edit'>Edit User Profile</a></font><br />"; ! ! if($MPCONF['USR']['isadmin'] == 1) { ! $content .= "<font size='1'><a href='" . $MPCONF['GEN']['uri'] . "/admin/index.php'>Administration Area</a></font>"; ! } } else { Index: usercp.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules/usercp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** usercp.php 10 Apr 2002 21:22:02 -0000 1.2 --- usercp.php 11 Apr 2002 05:40:15 -0000 1.3 *************** *** 8,12 **** function Init() { ! $this->pagetitle = "User Control Panel"; } --- 8,12 ---- function Init() { ! $this->pagetitle = "phpMP :: User Control Panel"; } |