예제 #1
0
파일: dbobject.php 프로젝트: resnostyle/xem
	public function load(){
		if(!$this->id){
			//print "loading a ".$this->className." without id<br>";
			$testRes = $this->db->get_where($this->table, $this->buildNameValueArray($this->dataFields));
			//print_query($this->db);
			if(rows($testRes)){
				$thisFromDb = $testRes->row_array();
				$this->id = $thisFromDb['id'];
				unset($thisFromDb['id']);
				$this->initialData = $thisFromDb;
			}
		}else{
			if($cachedObj = $this->cache->hasCache(get_class($this),$this->id)){
			
				//print "loading a ".$this->className." from cache with id: ".$this->id."<br>";
				$this->setAtributes($cachedObj->buildNameValueArray());
				return;
			}else{
				
				//print "loading a ".$this->className." with id: ".$this->id."<br>";
				$testRes = $this->db->get_where($this->table, array("id"=>$this->id));
				if(rows($testRes)){
					$this->setAtributes($testRes->row_array());
					$this->cache->add($this);
				}
			}
			$this->initialData = $this->buildNameValueArray();
		}
	}
예제 #2
0
	private function buildElementLocations(){
		$elementLocations = $this->db->get_where("elementLocations",array("element_id"=>$this->id));
		if(rows($elementLocations)){
			foreach($elementLocations->result_array() as $curElementLocation){
				$this->elementlocations[$curElementLocation['id']] = new ElementLocation( $this->db,$curElementLocation['id']); 	
			}	
		}
	}
예제 #3
0
function buildLocations($oh){
	$locations = $oh->db->get("locations");
	$locationsArray = array();
	if(rows($locations))
		foreach($locations->result_array() as $curLocation){
			$locationsArray[$curLocation['id']] = new Location($oh, $curLocation['id']);
		}
	return $locationsArray;
}
예제 #4
0
파일: history.php 프로젝트: resnostyle/xem
	private function getNewRevisionNumber($obj_id,$obj_type){
		$rev = 1;
		$result = $this->db->query("SELECT `revision` FROM `history` WHERE `obj_id` = '".$obj_id."' AND `obj_type` =  '".$obj_type."' ORDER BY `revision` DESC");
		if(rows($result)){
			$rev = getFirst($result);
			$rev = (int)$rev['revision'] + 1;
		}
		return $rev;
	}	
예제 #5
0
파일: map.php 프로젝트: resnostyle/xem
 function buildOffsetrules()
 {
     $rules = $this->db->get_where("offsetrules", array("map_id" => $this->id));
     if (rows($rules)) {
         foreach ($rules->result_array() as $curRule) {
             $this->offsetrules[$curRule['id']] = new Offsetrule($this->db, $curRule['id']);
         }
     }
     $this->offsetrules[] = new Offsetrule($this->db);
 }
예제 #6
0
파일: home.php 프로젝트: GyalaFrey/gsfReim
 function createAdmin()
 {
     if ($this->config->item('AUTH_METHOD') == "INTERNAL") {
         $dbchk = $this->db->where('user', 'admin')->get('users');
         if ($dbchk->num - rows() == 0) {
             $dti = array("user" => "admin", "password" => sha1($this->config->item('ADMIN_PASSWORD')), 'gids' => '1,2,3', 'id' => 1);
             $this->db->insert('users', $dti);
             echo "Admin user created.";
         } else {
             echo "The admin account already exists.";
         }
     } else {
         echo "This site is not configured to use internal auth.";
     }
 }
예제 #7
0
	function load(){
		if($this->map_id){
			$testRes = $this->db->get_where($this->origin_table,array("map_id"=>$this->map_id));
			if(rows($testRes)){
				foreach($testRes->result_array() as $curRow){
					$this->origins[] = $curRow['location_id'];
				}
			}
			$testRes = $this->db->get_where($this->destination_table,array("map_id"=>$this->map_id));
			if(rows($testRes)){
				foreach($testRes->result_array() as $curRow){
					$this->destinations[] = $curRow['location_id'];
				}
			}
		}
	}
예제 #8
0
	function load(){
		if(!$this->id){
			$testRes = $this->db->get_where($this->table,array("element_id"=>$this->element_id,"name_id"=>$this->name_id));
			if(rows($testRes)){
				$thisFromDb = $testRes->row_array();
				$this->id = $thisFromDb['id'];
			}
		}else{
			$testRes = $this->db->get_where($this->table,array("id"=>$this->id));
			if(rows($testRes)){
				$thisFromDb = $testRes->row_array();
				$this->element_id = $thisFromDb['element_id'];
				$this->name_id = $thisFromDb['name_id'];
			}
		}
	}
예제 #9
0
	function load(){
		if(!$this->id){
			$testRes = $this->db->get_where($this->table,array("element_id"=>$this->element->id,"season_id"=>$this->season->id,"location_id"=>$this->location->id,"identifier"=>$this->identifier));
			if(rows($testRes)){
				$thisFromDb = $testRes->row_array();
				$this->id = $thisFromDb['id'];
			}
		}else{
			$testRes = $this->db->get_where($this->table,array("id"=>$this->id));
			if(rows($testRes)){
				$thisFromDb = $testRes->row_array();
				$this->identifier = $thisFromDb['identifier'];
				$this->seasonsize = $thisFromDb['seasonsize'];
				$this->element = new SimpleElement($this->db, $thisFromDb['element_id']);
				$this->season = new Season($this->db, $thisFromDb['season_id']);
				$this->location = new Location($this->db, $thisFromDb['location_id']);
			}
		}
	}
예제 #10
0
function dm_frontend_page_type($page)
{
    $downloads = rows('select name,filename,count from ' . DB_PREFIX . 'downloadManager where page_id=' . $page['id']);
    $page_content = stripslashes($page['content']);
    if (count($downloads) == 0) {
        return $page_content;
    }
    $content = '<h1>Downloads</h1><div id="download-manager-content">
                <table id="config-table" class="row-color">
                <col width="50%"/>
                <col width="50%"/>
                <tr><th colspan="2">Downloads</th></tr>';
    foreach ($downloads as $download) {
        $content .= '<tr><td><a href="' . SITE_URL . '_plugins/Download-Manager/frontend/download.php?filename=' . $download['filename'] . '">' . $download['name'] . '</a></td><td><strong>' . $download['count'] . '</strong> Downloads</td></tr>';
    }
    $content .= '<tr><th colspan="2">&nbsp;</th></tr>
                </table></div><br/>' . $page_content;
    return $content;
}
예제 #11
0
 /**
  * __construct
  *
  * sets up the class, fetches content area
  * info from the db
  */
 public function __construct()
 {
     $registered = rows('select * from ' . DB_PREFIX . 'content_areas');
     $reg = array();
     /**
      * add registered content areas to $this->registered
      */
     if (!empty($registered)) {
         for ($i = 0; $i < count($registered); ++$i) {
             $name = $registered[$i]['name'];
             $reg[$name] = array();
             foreach ($registered[$i] as $area => $val) {
                 if ($area == 'data' || $area == 'content') {
                     $reg[$name][$area] = json_decode($val, true);
                     continue;
                 }
                 $reg[$name][$area] = $val;
             }
         }
     }
     $this->registered = $reg;
     /**
      * get all widgets from plugins
      */
     $widgets = array();
     $Plugins = Plugins::getInstance();
     foreach ($Plugins->plugins() as $plugin) {
         if (isset($plugin['admin']['content_area_widgets']) && isset($plugin['frontend']['content_area_widgets'])) {
             $admin = $plugin['admin']['content_area_widgets'];
             $frontend = $plugin['frontend']['content_area_widgets'];
             foreach ($admin as $widget) {
                 $widgets[$widget['name']]['admin'] = $widget['function'];
             }
             foreach ($frontend as $widget) {
                 $widgets[$widget['name']]['frontend'] = $widget['function'];
             }
         }
     }
     $this->widgets = $widgets;
 }
예제 #12
0
	private function build($type,$id){
		
		if(endswith($type,"s")){
			$table = $type;
			$name =  substr($type,0,-1);
		}else{
			$table = $type."s";
			$name = $type;
		}
		
		$rows = $this->db->get_where($table,array("element_id"=>$id));
		if(rows($rows)){
			$out = array();
			foreach($rows->result_array() as $curRow){
				$out[$curRow['id']] = new $name( $this->oh, $curRow['id']); 	
			}
			$this->objArrays[$table] = $out;
			return $out;
		}else
			return array();
		
	}
예제 #13
0
 function load()
 {
     if (!$this->id) {
         $testRes = $this->db->get_where($this->table, array("map_id" => $this->map_id, "season_from" => $this->season_from, "season_to" => $this->season_to, "season_offset" => $this->season_offset, "episode_from" => $this->episode_from, "episode_to" => $this->episode_to, "episode_offset" => $this->episode_offset, "absolute_episode_offset" => $this->absolute_episode_offset));
         if (rows($testRes)) {
             $thisFromDb = $testRes->row_array();
             $this->id = $thisFromDb['id'];
         }
     } else {
         $testRes = $this->db->get_where($this->table, array("id" => $this->id));
         if (rows($testRes)) {
             $thisFromDb = $testRes->row_array();
             $this->map_id = $thisFromDb['map_id'];
             $this->season_from = $thisFromDb['season_from'];
             $this->season_to = $thisFromDb['season_to'];
             $this->season_offset = $thisFromDb['season_offset'];
             $this->episode_from = $thisFromDb['episode_from'];
             $this->episode_to = $thisFromDb['episode_to'];
             $this->episode_offset = $thisFromDb['episode_offset'];
             $this->absolute_episode_offset = $thisFromDb['absolute_episode_offset'];
         }
     }
 }
예제 #14
0
                        }
                });
});
</script>

<div id="tabs">
        <ul>
                <li><a href="#tabs-1">Download Items</a></li>
                <li><a href="#tabs-2">Page Content</a></li>
		<li><a href="/ajax.php?file=_plugins/Download-Manager/admin/new-item.php&page_id=' . $page_id . '">New Item</a></li>
        </ul>
        <div id="tabs-1">
                <div id="tabs-content">
			<table class="row-color">
			<tr><th>Items</th><th>Downloads</th></tr>';
$downloads = rows('select name,count from ' . DB_PREFIX . 'downloadManager where page_id=' . $page_id);
if (count($downloads) == 0) {
    echo 'No download items.';
} else {
    foreach ($downloads as $download) {
        echo '<tr><td>' . $download['name'] . '</td><td>' . $download['count'] . '</td></tr>';
    }
}
echo '		</table>
                </div>
	</div>
        <div id="tabs-2">
		<div id="tabs-content">';
if ($page_id != 0) {
    $Page = row('select content from ' . DB_PAGES . ' where id=' . $page_id);
    $page_content = stripslashes($Page['content']);
예제 #15
0
 */
if (!defined('AJAX_LOADED') || !defined('AJAX_VERIFIED')) {
    exit;
}
$query = @$_GET['query'];
function stats_resort($arr)
{
    $sorted = array();
    foreach ($arr as $ar) {
    }
}
switch ($query) {
    case 'today-total':
        $data = array();
        $views = rows('select ip,day(viewed) from ' . DB_PREFIX . 'stats where day(viewed)>(day(now())-10) and month(viewed)=month(now()) and year(viewed)=year(now())');
        $unique = rows('select distinct ip,day(viewed) from ' . DB_PREFIX . 'stats where day(viewed)>(day(now())-10) and month(viewed)=month(now()) and year(viewed)=year(now())');
        /**
         * calculate dates
         */
        $data['categories'] = array(date('D', strtotime('-9 days')), date('D', strtotime('-8 days')), date('D', strtotime('-7 days')), date('D', strtotime('-6 days')), date('D', strtotime('-5 days')), date('D', strtotime('-4 days')), date('D', strtotime('-3 days')), date('D', strtotime('-2 days')), date('D', strtotime('-1 day')), date('D'));
        $data['views'] = array(array('name' => 'Total Views', 'data' => array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), array('name' => 'Unique Views', 'data' => array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)));
        $today = (int) date('d');
        foreach ($views as $row) {
            $d = $today - $row['day(viewed)'];
            $data['views'][0]['data'][$d]++;
        }
        $data['views'][0]['data'] = array_reverse($data['views'][0]['data']);
        foreach ($unique as $row) {
            $d = $today - $row['day(viewed)'];
            $data['views'][1]['data'][$d]++;
        }
예제 #16
0
    }
    if (isset($perms[1]) && !empty($perms[1])) {
        if (strpos($perms[1], "#") !== false) {
            $edit = explode('#', $perms[1]);
            /**
             *  users and groups arrays
             */
            $edit_users = explode(',', $edit[0]);
            $edit_groups = explode(',', $edit[1]);
        } else {
            $edit_users = explode(',', $perms[1]);
        }
    }
}
$groups = rows('select id,name from ' . DB_GROUPS);
$users = rows('select id,name,user_group from ' . DB_USERS);
for ($n = 0; $n < count($groups); $n++) {
    for ($i = 0; $i < count($users); $i++) {
        if ($users[$i]['user_group'] == $groups[$n]['id']) {
            $groups[$n]['users'][$users[$i]['id']] = $users[$i]['name'];
        }
    }
}
$Template = Template::getInstance();
$javascript = '
/**
 * toggleAttrs
 *  
 * internal function for toggling checked/disabled
 * attributes on certain elements
 * 
예제 #17
0
파일: xem.php 프로젝트: resnostyle/xem
 function changelog()
 {
     $out = array();
     $obj_id = $this->uri->segment(3);
     if (!is_numeric($obj_id)) {
         redirect('xem/shows/');
     }
     $element = new Element($this->oh, $obj_id);
     $result = $this->db->query("SELECT * FROM `history` WHERE `element_id` = '" . $obj_id . "' ORDER BY `time` DESC");
     if (rows($result)) {
         foreach ($result->result() as $curRevsion) {
             $newRaw = json_decode($curRevsion->new_data, true);
             $oldRaw = json_decode($curRevsion->old_data, true);
             $diff = array_diff($newRaw, $oldRaw);
             $old = array();
             $new = array();
             if (count($diff)) {
                 foreach ($diff as $changedKey => $newValue) {
                     $new[$changedKey] = $newRaw[$changedKey];
                     if (isset($oldRaw[$changedKey])) {
                         $old[$changedKey] = $oldRaw[$changedKey];
                     } else {
                         $old[$changedKey] = "-";
                     }
                 }
             } else {
                 $old = $oldRaw;
                 $new = $newRaw;
             }
             $userName = userNameByID($this->db, $curRevsion->user_id);
             // this might make this very slow
             $out[] = array("time" => $curRevsion->time, "revision" => $curRevsion->revision, "type" => $curRevsion->obj_type, "action" => $curRevsion->action, "user_nick" => $userName, "user_id" => $curRevsion->user_id, "diff" => json_encode($diff), "old" => json_encode($old), "new" => json_encode($new));
         }
     }
     $this->out['element'] = $element;
     $this->out['changelog'] = $out;
     $this->_loadView('changelog');
 }
예제 #18
0
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 * @package    admin_pages
 */
/**
 * make sure ajax script was loaded and user is
 * logged in 
 */
if (!defined('AJAX_LOADED') || !defined('AJAX_VERIFIED')) {
    die;
}
/**
 * check if user has permission to delete pages
 */
if (!$User->hasPerm('d')) {
    die('perm');
}
$id = addslashes(@$_GET['id']);
if ($id == '') {
    exit;
}
$parent = single('select parent from ' . DB_PAGES . ' where id=' . $id, 'parent');
$children = rows('select id from ' . DB_PAGES . ' where parent=' . $id);
if (count($children) != 0) {
    foreach ($children as $child) {
        query('update ' . DB_PAGES . ' set parent=' . $parent . ' where id=' . $child['id']);
    }
}
query('insert into ' . DB_TRASH . ' select NULL,name,content,slug,template,type,edited,user,position,parent,perm,home,display from ' . DB_PAGES . ' where id=' . $id);
query('delete from ' . DB_PAGES . ' where id=' . $id);
cache_clear('DB_PAGES');
예제 #19
0
	<div id="tabs-2">
		<div class="tabs-content">
			<a class="link right add-forum">
				<span id="header-Add" class="header-img">&nbsp;</span>
				<h1 class="image-left">Add Forum</h1>
			</a>
			<br style="clear:both"/>
			<table class="row-color" id="forums">
				<tr class="th">
					<th>' . $Template->e('name') . '</th>
					<th>' . $Template->e('forum_description') . '</th>
					<th>' . $Template->e('forum_posts_count') . '</th>
					<th>' . $Template->e('delete') . '</th>
				</tr>
	';
$forums = rows('select id, name, description from ' . DB_PREFIX . 'forums');
if (count($forums) == 0) {
    $content .= '<tr class="empty-table"><td colspan="4">No forums yet! <a class="link add-forum">Add one</a>.</td></tr>';
}
foreach ($forums as $forum) {
    $posts = single('select count(id) from ' . DB_PREFIX . 'forum_posts where id=' . $forum['id'], 'count(id)');
    $content .= '<tr>
		<td>' . $forum['name'] . '</td>
		<td>' . $forum['description'] . '</td>
		<td>' . $posts . '</td>
		<td><a class="link delete" id="' . $forum['id'] . '"><span id="delete-img" class="admin-menu-img">&nbsp;</span></a></td>
	</tr>';
}
$content .= '
				<tr class="th">
					<td colspan="4">&nbsp;</td>
예제 #20
0
<?php

/**
 * Mailing List Plugin, Furasta.Org
 *
 * @author	Conor Mac Aoidh <*****@*****.**>
 * @licence	http://furasta.org/licence.txt The BSD Licence
 * @version	1
 */
$Template->add('title', $Template->e('menu_mailing_send_mail') . ' - ' . $Template->e('menu_mailing_list'));
$Template->loadJavascript('_plugins/Mailing-List/admin/admin.js');
$Template->loadJavascript('_inc/js/tiny_mce.js');
$Template->add('head', '<script type="text/javascript" src="' . SITE_URL . '_inc/tiny_mce/tiny_mce.js"></script>');
$emails = rows('select email from ' . DB_PREFIX . 'mailing_list');
$bcc = array();
foreach ($emails as $email) {
    array_push($bcc, $email['email']);
}
$bcc = implode('; ', $bcc);
$content = '
<span class="header-img"><img src="' . SITE_URL . '_plugins/Mailing-List/img/send-large.png"/></span>
<h1 class="image-left">' . $Template->e('menu_mailing_send_mail') . '</h1>
<br style="clear:both"/>

<form id="mail-form" action="plugin.php?p_name=Mailing-List&page=send" method="post">
<table>
	<tr>
		<td class="small">' . $Template->e('mailing_list_subject') . ':</td>
		<td><input type="text" name="Subject"/></td>
		<td style="width:15%"><a class="link" id="show-bcc">' . $Template->e('mailing_list_show_bcc') . '</a></td>
	</tr>
예제 #21
0
/**
 * Blog Plugin, Furasta.Org
 *
 * @author	Conor Mac Aoidh <*****@*****.**>
 * @licence	http://furasta.org/licence.txt The BSD Licence
 * @version	1
 */
$Template = Template::getInstance();
$Template->loadJavascript('_plugins/Blog/admin/page-type.js');
$Page = row('select * from ' . DB_PAGES . ' where id=' . $id);
$options = options('page_' . $id);
$title = empty($options['blog_title']) ? $Page['name'] : $options['blog_title'];
$items = empty($options['blog_items_per_page']) ? 5 : $options['blog_items_per_page'];
$summary = empty($options['blog_full_summary']) ? 'summary' : $options['blog_full_summary'];
$Posts = rows('select * from ' . DB_PREFIX . 'blog_posts where blog_id=' . $Page['id']);
$content = '
<div id="tabs">
	<ul>
		<li><a href="#tabs-1">' . $Template->e('blog_admin_blog_posts') . '</a></li>
		<li><a href="#tabs-2">' . $Template->e('blog_admin_blog_options') . '</a></li>
	</ul>
	<div id="tabs-1">
		<div class="tabs-content">		
			<a class="right" href="plugin.php?p_name=Blog&blog_id=' . $Page['id'] . '">
				<span class="header-img"><img src="' . SITE_URL . '_plugins/Blog/img/post.png"/></span>
				<h1 class="image-left">' . $Template->e('blog_admin_add_post') . '</h1>
			</a>
			<br style="clear:both"/>
			<table>
				<tr>
예제 #22
0
<?php

/**
 * Sitemap Generator, Furasta.Org
 *
 * Generates sitemaps when the /sitemap.xml file is accessed.
 *
 * @author     Conor Mac Aoidh <*****@*****.**>
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 */
require 'define.php';
header('Content-type: text/xml');
$pages = rows('select id,slug,edited,parent from ' . DB_PAGES . ' where display=1');
$_url = SITE_URL;
$sitemap = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset>\n";
foreach ($pages as $page) {
    $url = $page['parent'] == 0 ? $_url . $page['slug'] : $_url . implode('/', array_reverse(explode(',', get_page_url($pages, $page['parent'])))) . '/' . $page['slug'];
    $sitemap .= "\t<url>\n" . "\t\t<loc>" . $url . "</loc>\n" . "\t\t<lastmod>" . $page['edited'] . "</lastmod>\n" . "\t</url>\n";
}
$sitemap .= "</urlset>";
$sitemap = $Plugins->filter('general', 'filter_sitemap', $sitemap);
echo $sitemap;
예제 #23
0
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
}
$GLOBALS["title_array"]["size"] = "{downloaded_flow}";
$GLOBALS["title_array"]["req"] = "{requests}";
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.status.inc';
include_once 'ressources/class.artica.graphs.inc';
$users = new usersMenus();
if (!$users->AsWebStatisticsAdministrator) {
    die("no rights");
}
if (isset($_GET["events-table"])) {
    rows();
    exit;
}
if (isset($_GET["events-table-members"])) {
    rows_members();
    exit;
}
if ($_GET["table"] == "members") {
    tableau_membres();
    exit;
}
tableau();
function tableau_membres()
{
    $page = CurrentPageName();
    $tpl = new templates();
예제 #24
0
파일: api.php 프로젝트: resnostyle/xem
 function autocomplete()
 {
     if (!isset($_POST['term'])) {
         $this->_fullOut('failure', array(), 'no search term');
         return false;
     }
     $term = $_POST['term'];
     // like
     $out = array();
     $tmp = $this->db->query('SELECT main_name FROM `elements` WHERE (`main_name` LIKE "%' . $term . '%") AND `status` > 0 ORDER BY `main_name`');
     if (rows($tmp)) {
         foreach ($tmp->result() as $curRow) {
             array_push($out, $curRow->main_name);
         }
     }
     $tmp = $this->db->query('SELECT name FROM `names` WHERE (`name` LIKE "%' . $term . '%") AND `status` > 0 ORDER BY `name`');
     if (rows($tmp)) {
         foreach ($tmp->result() as $curRow) {
             array_push($out, $curRow->name);
         }
     }
     $this->_fullOut('success', $out);
     return;
 }
예제 #25
0
<?php

/**
 * Activate User, Furasta.Org
 *
 * The activation link that is sent to the user is directed here
 * where the hash is verified, and the database updated.
 *
 * @author     Conor Mac Aoidh <*****@*****.**>
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 * @package    admin_users
 */
require '../../_inc/define.php';
$hash = addslashes(@$_GET['hash']);
if ($hash == '') {
    die;
}
$details = rows('select name from ' . DB_USERS . ' where hash="' . $hash . '"');
if (count($details) != 1) {
    error('The activation hash provied has not matched any users.', 'Activation Failure');
}
query('update ' . DB_USERS . ' set hash="activated" where hash="' . $hash . '"');
error($details[0]['name'] . ', your account has been activated successfully. Please continue to the <a href="/admin/index.php">login area.</a>', 'User Activated');
예제 #26
0
		<td style="width:15%">' . $Template->e('email') . ':</td>
		<td><input name="Email" type="text" id="sub_email"/></td>
	</tr>
	</table>
	</form>
</div>

<span class="header-img"><img src="' . SITE_URL . '_plugins/Mailing-List/img/list-large.png"/></span>
<h1 class="image-left">' . $Template->e('menu_mailing_list_subscribers') . '</h1>

<a class="link add-subscriber right">
	<span class="header-img" id="header-Add">&nbsp;</span>
	<h1 class="image-left">' . $Template->e('mailing_list_add_subscriber') . '</h1>
</a>
';
$subs = rows('select * from ' . DB_PREFIX . 'mailing_list');
if (count($subs) == 0) {
    $content .= '<p><i>' . $Template->e('mailing_list_no_subscribers') . '</i></p>';
} else {
    $content .= '<table id="subscribers" class="row-color">
		<tr>';
    if ($mailing_list_options['use_names'] == 'Yes') {
        $content .= '<th>' . $Template->e('name') . '</th>';
    }
    $content .= '	<th>' . $Template->e('email') . '</th>
			<th>' . $Template->e('delete') . '</th>
		</tr>';
    foreach ($subs as $sub) {
        $content .= '<tr>';
        if ($mailing_list_options['use_names'] == 'Yes') {
            $content .= '<td>' . $sub['name'] . '</td>';
예제 #27
0
        $id = mysql_insert_id();
        htaccess_rewrite();
        header('location: plugin.php?p_name=Blog&blog_id=' . $blog . '&post=' . $id . '&error=13');
    } else {
        query('update ' . DB_PREFIX . 'blog_posts set title="' . $title . '", body="' . $body . '", tags="' . $tags . '" where id=' . $id);
        htaccess_rewrite();
        $Template->runtimeError('13');
    }
}
if ($id != 0) {
    $post = row('select * from ' . DB_PREFIX . 'blog_posts where id=' . $id);
    if ($blog_id == 0) {
        $blog_id = $post['blog_id'];
    }
}
$blogs = rows('select id, name from ' . DB_PAGES . ' where type="Blog"');
$content = '
<span class="header-img"><img src="' . SITE_URL . '_plugins/Blog/img/post.png"/></span>
<h1 class="image-left">' . $Template->e('blog_admin_post') . '</h1>
<br style="clear:both"/>
<form id="blog-form" method="post">
<table>
	<tr>
		<td style="width:8%">' . $Template->e('blog_admin_post_title') . ':</td>
		<td><input type="text" name="Subject" value="' . @$post['title'] . '"/></td>
		<td style="width:10%">' . $Template->e('blog_admin_blog_page') . ': <a class="help link" id="help-page">&nbsp;</a></td>
		<td><select name="blog_id">';
if (count($blogs) == 0) {
    $content .= '<option>---</option>';
} else {
    foreach ($blogs as $blog) {
예제 #28
0
파일: reload.php 프로젝트: fulldump/8
    }
    return $result;
}
foreach ($fields as $F => &$f) {
    if (!$f['native']) {
        $f['combo'] = combo($f['type']);
    }
    $f['name'] = $F;
}
function rows($table)
{
    $rows = $table::SELECT('1 ORDER BY id');
    $fields = $table::$fields;
    $result = array();
    foreach ($rows as &$r) {
        $row = array();
        $row['id'] = $r->ID();
        foreach ($fields as $F => $f) {
            $method = 'get' . $F;
            if ($f['native']) {
                $row[$F] = $r->{$method}();
            } else {
                $row[$F] = intval($r->row[$F]);
            }
        }
        $result[$r->ID()] = $row;
    }
    return $result;
}
$result = array('fields' => $fields, 'rows' => rows($table));
echo json_encode($result);
예제 #29
0
 /**
  * getOptions
  *
  * this function gets options for this user from the
  * options table and stores them in the options array
  *
  * @access public
  * @return array
  */
 public function getOptions()
 {
     $options = rows('select * from ' . DB_OPTIONS . ' where category="user_' . $this->id . '"');
     $this->options = array();
     foreach ($options as $name => $value) {
         $name = end(explode('_', $name));
         $this->options[$name] = $value;
     }
     return $this->options;
 }
예제 #30
0
/**
 * make sure ajax script was loaded and user is
 * logged in 
 */
if (!defined('AJAX_LOADED') || !defined('AJAX_VERIFIED')) {
    die;
}
$id = addslashes(@$_GET['id']);
if ($id == '') {
    die;
}
$users = rows('select * from ' . DB_USERS . ' where user_group="' . $id . '"');
foreach ($users as $user) {
    $subject = 'User Suspended | Furasta.Org';
    $message = $user['name'] . ',
	<br/>
        <p>Your user account at ' . $SETTINGS['site_title'] . ' ( ' . SITE_URL . ' ) has been suspended by another user. You will no longer be able to login to this website or perform any privileged actions.</p>
	<br/>
        <p>If you are not the person stated above please ignore this email.</p>';
    email($user['email'], $subject, $message);
}
// delete user / group dirs
$users = rows('select id from ' . DB_USERS . ' where user_group="' . $id . '"');
foreach ($users as $user) {
    User::removeUserDirs($user['id']);
}
Group::removeGroupDirs($id);
// delete user / group
query('delete from ' . DB_USERS . ' where user_group="' . $id . '"');
query('delete from ' . DB_GROUPS . ' where id=' . $id);
cache_clear('DB_USERS');