Copyright 2012 ABagrintsev This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Inheritance: extends model_base
示例#1
0
 function blogshow($sendrecv, $sendrecv2)
 {
     $scnublog = new scnublog();
     $finally2 = $scnublog->blogshow($sendrecv, $sendrecv2);
     $blogresult = new blog();
     $blogresult->showout($finally2);
 }
示例#2
0
文件: index.php 项目: ygres/sblog
 function index()
 {
     if (isset($this->args[0]) && $this->args[0] != "index") {
         system::setParam("page", "layout");
         $cacheID = $this->args[0] . "|ARTICLE";
         $this->smarty->setCacheID($cacheID);
         if (isset($_POST["contentID"]) && $_POST["contentID"]) {
             comments::add(intval($_POST["contentID"]));
         }
         $this->smarty->assign("isFav", blog::isFavorite($this->args[0]));
         if (!$this->smarty->isCached()) {
             $sqlData = blog::getOnePost($this->args[0], "article")->fetch();
             if ($sqlData) {
                 $this->smarty->assign("comments", comments::get(intval($sqlData["contentID"])));
                 $this->smarty->assign("post", $sqlData);
             }
         }
     } else {
         $offset = 1;
         system::setParam("page", "list");
         if (isset($this->get["offset"])) {
             $offset = intval($this->get["offset"]);
         }
         $cacheID = "ARTICLES|artoffset_{$offset}";
         $this->smarty->setCacheID($cacheID);
         if (!$this->smarty->isCached()) {
             $allCount = $this->db->query("SELECT COUNT(*) as cnt FROM `content` WHERE `type`='article'")->fetch();
             $this->smarty->assign("posts", news::getPosts(core::pagination($allCount["cnt"], $offset), "article")->fetchAll());
         }
     }
 }
示例#3
0
 public static function mainPage()
 {
     $allCount = self::$db->query("SELECT COUNT(*) as cnt, c.`contentID`, cc.`contentID` FROM `content` as c, " . "`content_category` as cc WHERE cc.`contentID`=c.`contentID` AND c.`showOnSite`='Y'")->fetch();
     $sqlData = blog::getPosts(core::pagination($allCount["cnt"]))->fetchAll();
     //if ($sqlData)
     //{
     //blog::highlightCode ($sqlData, "short");
     //}
     return $sqlData;
 }
示例#4
0
文件: index.php 项目: ygres/sblog
 function listPage()
 {
     system::setParam("page", "listPage");
     blog::buildList("video");
     $id = 0;
     // @mgenry соблюдай типизацию, мудак блять
     $action = '';
     if (isset($_GET["contentID"]) && isset($_GET["action"])) {
         $id = intval($_GET["contentID"]);
         $action = $_GET["action"];
     }
     if ($action == 'delete') {
         blog::buildList("video");
     }
 }
示例#5
0
文件: portfolio.php 项目: ygres/sblog
 function editItem()
 {
     $id = intval($_GET["id"]);
     $doRedirect = false;
     if (isset($_POST["savePost"])) {
         blog::updatePost($id, $_POST);
         $doRedirect = true;
     }
     if (isset($_POST["uploadPicture"])) {
         $uploadedPics = blog::uploadOnePicture($_POST["slug"]);
     }
     system::setParam("page", "editPortfolioItem");
     $sqlData = blog::buildForm("portfolio", "AND `id`={$id}");
     blog::showAttachedPics($sqlData, "portfolioPics");
     if ($doRedirect) {
         system::redirect(system::param("urlBase") . "items");
     }
 }
示例#6
0
文件: index.php 项目: ygres/sblog
 function edit()
 {
     $id = intval($_GET["entryID"]);
     $doRedirect = false;
     system::setParam("page", "addPage");
     if (!$id) {
         return system::redirect("/adm/listPage");
     }
     if (isset($_POST) && $_POST) {
         $url = $_POST["URL"];
         if ($this->db->query("UPDATE `redirect` SET `URL`='?' WHERE `entryID`=?", $url, $id)) {
             $doRedirect = true;
         }
     }
     $sqlData = blog::buildForm("redirect", array("AND `entryID`={$id}"));
     if ($doRedirect) {
         system::redirect("/adm/redirect/listPage");
     }
 }
示例#7
0
文件: users.php 项目: ygres/sblog
 function edit()
 {
     if (empty($_GET["userID"])) {
         return false;
     }
     $doRedirect = false;
     system::setParam("page", "userEdit");
     if (isset($_POST["savePost"])) {
         $data = $_POST;
         unset($data["savePost"]);
         if (!empty($data["password"])) {
             $data["password"] = md5(md5($data["password"]));
         } else {
             unset($data["password"]);
         }
         $this->db->updateTable("users", $data, "userID", $_GET["userID"]);
         $doRedirect = true;
     }
     blog::buildForm("users", "AND `userID`=" . intval($this->args[0]));
     if ($doRedirect) {
         system::redirect(system::param("urlBase") . "users");
     }
 }
示例#8
0
 public static function initialVerify($ignoreExistingPost = false)
 {
     if (!empty($_POST["slug"])) {
         $_POST["slug"] = blog::handlePostName($_POST["slug"]);
     } else {
         if (!empty($_POST["title"])) {
             $_POST["slug"] = blog::handlePostName($_POST["title"]);
         }
     }
     if (!$ignoreExistingPost && self::postExist("slug", $_POST["slug"])) {
         system::registerEvent("error", "slug", "Такой адрес объекта уже занят", "URL");
     }
     if (empty($_POST["title"])) {
         system::registerEvent("error", "title", "Заголовок не может быть пустым", "Заголовок объекта");
     }
     if (isset($_FILES["picRealUpload"]) && $_FILES["picRealUpload"]["error"] === 0) {
         system::registerEvent("error", "picUpld", "Ошибка при загрузке файла", "Файл картинки");
     }
     if (system::checkErrors()) {
         return false;
     }
     return true;
 }
示例#9
0
 public function edit($id)
 {
     $post = ORM::factory('blog_post', (int) $id);
     if (!$post->loaded) {
         message::error(__('Invalid ID'), 'admin/blog');
     }
     $this->head->title->append(__('Edit: %title', array('%title' => $post->title)));
     $this->template->title .= __('Edit: %title', array('%title' => $post->title));
     $form = Formo::factory()->plugin('csrf')->add('text', 'title', array('label' => __('Title'), 'value' => $post->title))->add('textarea', 'blog_content', array('label' => __('Content'), 'value' => $post->content))->add('text', 'tags', array('label' => __('Tags: <small>(Comma separated)</small>'), 'value' => $post->tags))->add('submit', 'submit', array('label' => __('Submit')))->add_rule('title', 'required', __('Please choose a title'));
     if ($form->validate()) {
         if ($form->title->value !== $post->title) {
             $post->uri = blog::unique_title($form->title->value);
         }
         $post->title = $form->title->value;
         $post->content = $form->blog_content->value;
         $post->tags = $form->tags->value;
         $post->save();
         Cache::instance()->delete('s7n_blog_feed');
         Cache::instance()->delete_tag('route');
         message::info(__('Post edited successfully'), 'admin/blog/edit/' . (int) $id);
     }
     $this->template->content = View::factory('blog/edit', $form->get(TRUE));
     $this->template->content->post = $post;
 }
示例#10
0
 public static function picture()
 {
     if (!portfolio::initialVerify(true)) {
         echo '<script type="text/javascript">parent.pupld.uploadError ("' . addslashes(json_encode(system::$errors)) . '")</script>';
         return;
     }
     if (isset($_POST["ajaxFileUpload"]) && isset($_POST["pageDir"])) {
         if (isset($_POST["slug"]) && $_POST["slug"]) {
             $slug = preg_replace("/[^a-zа-яё0-9\\-\\_]+/i", '', $_POST["slug"]);
         } else {
             $slug = "";
         }
         if (isset($_POST["pageDir"]) && $_POST["pageDir"]) {
             $pageDir = preg_replace("/[^a-z0-9]+/i", '', $_POST["pageDir"]);
         } else {
             $pageDir = "";
         }
         $uploadedPics = blog::uploadOnePicture($slug, $pageDir);
         $uploadedPics["picUpld"]["itemName"] = $slug;
         if (!empty($uploadedPics)) {
             echo '<script type="text/javascript">parent.pupld.uploadFinished ("' . addslashes(json_encode($uploadedPics["picUpld"])) . '")</script>';
         }
     }
 }
示例#11
0
    /**
     * main routine to convert old school module data into new controller format
     * @global db the exponent database object
     * @param  $iloc
     * @param  $module
     * @param int $hc
     * @return
     */
    private function convert($iloc, $module, $hc = 0)
    {
        if (!array_key_exists($iloc->mod, $this->params['migrate'])) {
            return $module;
        }
        global $db;
        $old_db = $this->connect();
        $linked = false;
        $loc = null;
        switch ($iloc->mod) {
            case 'textmodule':
                @($module->view = 'showall');
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'textmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'textmodule';
                $textitems = $old_db->selectObjects('textitem', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new text();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'rotatormodule':
                $module->action = 'showRandom';
                $module->view = 'showRandom';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'rotatormodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'rotatormodule';
                $textitems = $old_db->selectObjects('rotator_item', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new text();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'snippetmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "snippet";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'snippetmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'snippetmodule';
                $textitems = $old_db->selectObjects('textitem', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new snippet();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "snippet";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        // if the item exists in the current db, we won't save it
                        $te = $text->find('first', "location_data='" . $text->location_data . "'");
                        if (empty($te)) {
                            $text->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        }
                    }
                }
                break;
            case 'linklistmodule':
                switch ($module->view) {
                    case 'Quick Links':
                        @($module->view = "showall_quicklinks");
                        break;
                    default:
                        @($module->view = 'showall');
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "links";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'linklistmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'linklistmodule';
                $links = $old_db->selectArrays('linklist_link', "location_data='" . serialize($iloc) . "'");
                if ($links) {
                    foreach ($links as $link) {
                        $lnk = new links();
                        $loc = expUnserialize($link['location_data']);
                        $loc->mod = "links";
                        $lnk->title = !empty($link['name']) ? $link['name'] : 'Untitled';
                        $lnk->body = $link['description'];
                        $lnk->new_window = $link['opennew'];
                        $lnk->url = !empty($link['url']) ? $link['url'] : '#';
                        $lnk->rank = $link['rank'];
                        $lnk->poster = 1;
                        $lnk->editor = 1;
                        $lnk->location_data = serialize($loc);
                        $lnk->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'linkmodule':
                // user mod, not widely distributed
                switch ($module->view) {
                    case 'Summary':
                        @($module->view = "showall_quicklinks");
                        break;
                    default:
                        @($module->view = 'showall');
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "links";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'linkmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'linkmodule';
                $links = $old_db->selectArrays('link', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('linkmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($links) {
                    foreach ($links as $link) {
                        $lnk = new links();
                        $loc = expUnserialize($link['location_data']);
                        $loc->mod = "links";
                        $lnk->title = !empty($link['name']) ? $link['name'] : 'Untitled';
                        $lnk->body = $link['description'];
                        $lnk->new_window = $link['opennew'];
                        $lnk->url = !empty($link['url']) ? $link['url'] : '#';
                        $lnk->rank = $link['rank'];
                        $lnk->poster = 1;
                        $lnk->editor = 1;
                        $lnk->location_data = serialize($loc);
                        $lnk->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                    if ($oldconfig->enable_rss == 1) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig = new expConfig();
                        $newconfig->config = $config;
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                }
                break;
            case 'swfmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'swfmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'swfmodule';
                $swfitems = $old_db->selectObjects('swfitem', "location_data='" . serialize($iloc) . "'");
                if ($swfitems) {
                    foreach ($swfitems as $ti) {
                        $text = new text();
                        $file = new expFile($ti->swf_id);
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->title = $ti->name;
                        $swfcode = '
							<p>
							 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="' . $ti->height . '" width="' . $ti->width . '">
								 <param name="bgcolor" value="' . $ti->bgcolor . '" />
									' . ($ti->transparentbg ? "<param name=\"wmode\" value=\"transparent\" />" : "") . '
								 <param name="quality" value="high" />
								 <param name="movie" value="' . $file->path_relative . '" />
								 <embed bgcolor= "' . $ti->bgcolor . '" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' . $file->path_relative . '" type="application/x-shockwave-flash" height="' . $ti->height . '" width="' . $ti->width . '"' . ($ti->transparentbg ? " wmode=\"transparent\"" : "") . '>
								 </embed>
							 </object>
							</p>
						';
                        $text->body = $swfcode;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'newsmodule':
                if ($module->view == 'Featured News') {
                    $only_featured = true;
                }
                switch ($module->view) {
                    case 'Headlines':
                        $module->view = 'showall_headlines';
                        break;
                    case 'Summary':
                        $module->view = 'showall_summary';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "news";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'newsmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'newsmodule';
                $newsitems = $old_db->selectArrays('newsitem', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('newsmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($newsitems) {
                    $files_attached = false;
                    foreach ($newsitems as $ni) {
                        unset($ni['id']);
                        $news = new news($ni);
                        $loc = expUnserialize($ni['location_data']);
                        $loc->mod = "news";
                        $news->location_data = serialize($loc);
                        $news->title = !empty($ni['title']) ? $ni['title'] : gt('Untitled');
                        $news->body = !empty($ni['body']) ? $ni['body'] : gt('(empty)');
                        $news->save();
                        // default is to create with current time
                        $news->created_at = $ni['posted'];
                        $news->edited_at = $ni['edited'];
                        $news->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        if (!empty($ni['file_id'])) {
                            $file = new expFile($ni['file_id']);
                            $news->attachitem($file, '');
                            $files_attached = true;
                        }
                    }
                    $newconfig = new expConfig();
                    if ($files_attached) {
                        // fudge a config to get attached files to appear
                        $newconfig->config = 'a:14:{s:9:"feedmaker";s:0:"";s:11:"filedisplay";s:7:"Gallery";s:6:"ffloat";s:4:"Left";s:6:"fwidth";s:3:"120";s:7:"fmargin";s:1:"5";s:7:"piwidth";s:3:"100";s:5:"thumb";s:3:"100";s:7:"spacing";s:2:"10";s:10:"floatthumb";s:8:"No Float";s:6:"tclass";s:0:"";s:5:"limit";s:0:"";s:9:"pagelinks";s:14:"Top and Bottom";s:10:"feed_title";s:0:"";s:9:"feed_desc";s:0:"";}';
                    }
                    if ($oldconfig->enable_rss == 1) {
                        if ($newconfig->config != null) {
                            $config = expUnserialize($newconfig->config);
                        }
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig->config = $config;
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                    if ($only_featured) {
                        $newconfig->config['only_featured'] = true;
                    }
                    if ($newconfig != null) {
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                    }
                }
                break;
            case 'resourcesmodule':
                switch ($module->view) {
                    case 'One Click Download - Descriptive':
                        $module->view = 'showall_quick_download_with_description';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "filedownload";
                if ($db->countObjects('filedownloads', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'resourcesmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'resourcesmodule';
                $resourceitems = $old_db->selectArrays('resourceitem', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('resourcesmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($resourceitems) {
                    foreach ($resourceitems as $ri) {
                        unset($ri['id']);
                        $filedownload = new filedownload($ri);
                        $loc = expUnserialize($ri['location_data']);
                        $loc->mod = "filedownload";
                        $filedownload->title = !empty($ri['name']) ? $ri['name'] : 'Untitled';
                        $filedownload->body = $ri['description'];
                        $filedownload->downloads = $ri['num_downloads'];
                        $filedownload->location_data = serialize($loc);
                        if (!empty($ri['file_id'])) {
                            $filedownload->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                            $file = new expFile($ri['file_id']);
                            $filedownload->attachitem($file, 'downloadable');
                            // default is to create with current time
                            $filedownload->created_at = $ri['posted'];
                            $filedownload->edited_at = $ri['edited'];
                            $filedownload->update();
                        }
                    }
                    if (isset($oldconfig->enable_rss)) {
                        $dorss = $oldconfig->enable_rss;
                    } elseif (isset($oldconfig->enable_podcasting)) {
                        $dorss = $oldconfig->enable_podcasting;
                    } else {
                        $dorss = false;
                    }
                    if ($dorss) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig = new expConfig();
                        $newconfig->config = $config;
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        //						$newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->enable_rss = true;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                }
                break;
            case 'imagegallerymodule':
                switch ($module->view) {
                    case 'Slideshow':
                        $module->action = 'slideshow';
                        $module->view = 'showall';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "photos";
                if ($db->countObjects('photo', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'imagegallerymodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'imagegallerymodule';
                $galleries = $old_db->selectArrays('imagegallery_gallery', "location_data='" . serialize($iloc) . "'");
                if ($galleries) {
                    foreach ($galleries as $gallery) {
                        $gis = $old_db->selectArrays('imagegallery_image', "gallery_id='" . $gallery['id'] . "'");
                        foreach ($gis as $gi) {
                            $photo = new photo();
                            $loc = expUnserialize($gallery['location_data']);
                            $loc->mod = "photos";
                            $photo->title = !empty($gi['name']) ? $gi['name'] : 'Untitled';
                            $photo->body = $gi['description'];
                            $photo->alt = $gi['alt'];
                            $photo->location_data = serialize($loc);
                            if (!empty($gi['file_id'])) {
                                $photo->save();
                                @$this->msg['migrated'][$iloc->mod]['count']++;
                                @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                                $file = new expFile($gi['file_id']);
                                $photo->attachitem($file, '');
                                $photo->created_at = $gi['posted'];
                                $photo->edited_at = $gi['posted'];
                                $photo->update(array("validate" => false));
                            }
                        }
                    }
                }
                break;
            case 'slideshowmodule':
                $module->action = 'slideshow';
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "photos";
                if ($db->countObjects('photo', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'slideshowmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'slideshowmodule';
                $galleries = $old_db->selectArrays('imagegallery_gallery', "location_data='" . serialize($iloc) . "'");
                if ($galleries) {
                    foreach ($galleries as $gallery) {
                        $gis = $old_db->selectArrays('imagegallery_image', "gallery_id='" . $gallery['id'] . "'");
                        foreach ($gis as $gi) {
                            $photo = new photo();
                            $loc = expUnserialize($gallery['location_data']);
                            $loc->mod = "photos";
                            $photo->title = !empty($gi['name']) ? $gi['name'] : 'Untitled';
                            $photo->body = $gi['description'];
                            $photo->alt = $gi['alt'];
                            $photo->location_data = serialize($loc);
                            $te = $photo->find('first', "location_data='" . $photo->location_data . "'");
                            if (empty($te)) {
                                if (!empty($gi['file_id'])) {
                                    $photo->save();
                                    @$this->msg['migrated'][$iloc->mod]['count']++;
                                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                                    $file = new expFile($gi['file_id']);
                                    $photo->attachitem($file, '');
                                    $photo->created_at = $gi['posted'];
                                    $photo->edited_at = $gi['posted'];
                                    $photo->update();
                                }
                            }
                        }
                    }
                }
                break;
            case 'headlinemodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'headlinemodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'headlinemodule';
                $headlines = $old_db->selectObjects('headline', "location_data='" . serialize($iloc) . "'");
                if ($headlines) {
                    foreach ($headlines as $hl) {
                        $headline = new text();
                        $loc = expUnserialize($hl->location_data);
                        $loc->mod = "text";
                        $headline->location_data = serialize($loc);
                        $headline->title = $hl->headline;
                        $headline->poster = 1;
                        //                        $headline->created_at = time();
                        //                        $headline->edited_at = time();
                        $headline->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'weblogmodule':
                switch ($module->view) {
                    case 'By Author':
                        $module->action = 'authors';
                        $module->view = 'authors';
                        break;
                    case 'By Tag':
                        $module->action = 'tags';
                        $module->view = 'tags_list';
                        break;
                    case 'Monthly':
                        $module->action = 'dates';
                        $module->view = 'dates';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "blog";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'weblogmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'weblogmodule';
                $blogitems = $old_db->selectArrays('weblog_post', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('weblogmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($blogitems) {
                    foreach ($blogitems as $bi) {
                        unset($bi['id']);
                        $post = new blog($bi);
                        $loc = expUnserialize($bi['location_data']);
                        $loc->mod = "blog";
                        $post->location_data = serialize($loc);
                        $post->title = !empty($bi['title']) ? $bi['title'] : gt('Untitled');
                        $post->body = !empty($bi['body']) ? $bi['body'] : gt('(empty)');
                        $post->save();
                        // default is to create with current time
                        $post->created_at = $bi['posted'];
                        $post->edited_at = $bi['edited'];
                        $post->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        // this next section is moot since there are no attachments to blogs
                        // if (!empty($bi['file_id'])) {
                        // $file = new expFile($bi['file_id']);
                        // $post->attachitem($file,'downloadable');
                        // }
                        if (isset($oldconfig->enable_tags) && ($oldconfig->enable_tags = true)) {
                            $params = null;
                            $oldtags = expUnserialize($bi['tags']);
                            foreach ($oldtags as $oldtag) {
                                $tagtitle = strtolower(trim($old_db->selectValue('tags', 'name', 'id = ' . $oldtag)));
                                $tag = new expTag($tagtitle);
                                //								$tag->title = $old_db->selectValue('tags','name','id = '.$oldtag);
                                if (empty($tag->id)) {
                                    $tag->update(array('title' => $tagtitle));
                                }
                                $params['expTag'][] = $tag->id;
                            }
                            $post->update($params);
                        }
                        $comments = $old_db->selectArrays('weblog_comment', "parent_id='" . $post->id . "'");
                        foreach ($comments as $comment) {
                            unset($comment['id']);
                            $newcomment = new expComment($comment);
                            $newcomment->created_at = $comment['posted'];
                            $newcomment->edited_at = $comment['edited'];
                            $newcomment->update();
                            // attach the comment to the blog post it belongs to
                            $obj->content_type = 'blog';
                            $obj->content_id = $post->id;
                            $obj->expcomments_id = $newcomment->id;
                            if (isset($this->params['subtype'])) {
                                $obj->subtype = $this->params['subtype'];
                            }
                            $db->insertObject($obj, $newcomment->attachable_table);
                        }
                    }
                    $newconfig = new expConfig();
                    $config['add_source'] = '1';
                    if ($oldconfig->enable_rss == 1) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                    $newconfig->config = $config;
                    $newconfig->location_data = $loc;
                    $newconfig->save();
                }
                break;
            case 'faqmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "faq";
                if ($db->countObjects('faqs', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'faqmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'faqmodule';
                $faqs = $old_db->selectArrays('faq', "location_data='" . serialize($iloc) . "'");
                if ($faqs) {
                    foreach ($faqs as $fqi) {
                        unset($fqi['id']);
                        $faq = new faq($fqi);
                        $loc = expUnserialize($fqi['location_data']);
                        $loc->mod = "faq";
                        $faq->location_data = serialize($loc);
                        $faq->question = !empty($fqi['question']) ? $fqi['question'] : 'Untitled?';
                        $faq->answer = $fqi['answer'];
                        $faq->rank = $fqi['rank'];
                        $faq->include_in_faq = 1;
                        $faq->submitter_name = 'Unknown';
                        $faq->submitter_email = '*****@*****.**';
                        $faq->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'listingmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "portfolio";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'listingmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'listingmodule';
                $listingitems = $old_db->selectArrays('listing', "location_data='" . serialize($iloc) . "'");
                if ($listingitems) {
                    $files_attached = false;
                    foreach ($listingitems as $li) {
                        unset($li['id']);
                        $listing = new portfolio($li);
                        $listing->title = !empty($li['name']) ? $li['name'] : 'Untitled?';
                        $loc = expUnserialize($li['location_data']);
                        $loc->mod = "portfolio";
                        $listing->location_data = serialize($loc);
                        $listing->featured = true;
                        $listing->poster = 1;
                        $listing->body = "<p>" . $li['summary'] . "</p>" . $li['body'];
                        $listing->save();
                        // default is to create with current time
                        $listing->created_at = time();
                        $listing->edited_at = time();
                        $listing->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        if (!empty($li['file_id'])) {
                            $file = new expFile($li['file_id']);
                            $listing->attachitem($file, '');
                            $files_attached = true;
                        }
                    }
                    if ($files_attached) {
                        // fudge a config to get attached files to appear
                        $config = new expConfig();
                        $config->location_data = $loc;
                        $config->config = 'a:11:{s:11:"filedisplay";s:7:"Gallery";s:6:"ffloat";s:4:"Left";s:6:"fwidth";s:3:"120";s:7:"fmargin";s:1:"5";s:7:"piwidth";s:3:"100";s:5:"thumb";s:3:"100";s:7:"spacing";s:2:"10";s:10:"floatthumb";s:8:"No Float";s:6:"tclass";s:0:"";s:5:"limit";s:0:"";s:9:"pagelinks";s:14:"Top and Bottom";}';
                        $config->save();
                    }
                }
                break;
            case 'contactmodule':
                // convert to an old school form
                $module->view == "Default";
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "formmodule";
                if ($db->countObjects('formbuilder_form', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'contactmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'contactmodule';
                $contactform = $old_db->selectObject('contactmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($contactform) {
                    $loc = expUnserialize($contactform->location_data);
                    $loc->mod = 'formmodule';
                    $contactform->location_data = serialize($loc);
                    //				$replyto_address = $contactform->replyto_address;
                    unset($contactform->replyto_address);
                    //				$from_address = $contactform->from_address;
                    unset($contactform->from_address);
                    //				$from_name = $contactform->from_name;
                    unset($contactform->from_name);
                    unset($contactform->use_captcha);
                    $contactform->name = 'Send us an e-mail';
                    $contactform->description = '';
                    $contactform->response = $contactform->final_message;
                    unset($contactform->final_message);
                    $contactform->table_name = '';
                    $contactform->is_email = true;
                    $contactform->is_saved = false;
                    $contactform->submitbtn = 'Send Message';
                    $contactform->resetbtn = 'Reset';
                    unset($contactform->id);
                    $contactform->id = $db->insertObject($contactform, 'formbuilder_form');
                    $addresses = $old_db->selectObjects('contact_contact', "location_data='" . serialize($iloc) . "'");
                    foreach ($addresses as $address) {
                        unset($address->addressbook_contact_id);
                        unset($address->contact_info);
                        unset($address->location_data);
                        $address->form_id = $contactform->id;
                        $db->insertObject($address, 'formbuilder_address');
                    }
                    $report = null;
                    $report->name = $contactform->subject;
                    $report->location_data = $contactform->location_data;
                    $report->form_id = $contactform->id;
                    $db->insertObject($report, 'formbuilder_report');
                    // now add the controls to the form
                    $control = null;
                    $control->name = 'name';
                    $control->caption = 'Your Name';
                    $control->form_id = $contactform->id;
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:9:"Your Name";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:4:"name";}';
                    $control->rank = 0;
                    $control->is_readonly = 0;
                    $control->is_static = 0;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'email';
                    $control->caption = 'Your Email';
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:18:"Your Email Address";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:5:"email";}';
                    $control->rank = 1;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'subject';
                    $control->caption = 'Subject';
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:7:"Subject";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:7:"subject";}';
                    $control->rank = 2;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'message';
                    $control->caption = 'Message';
                    $control->data = 'O:17:"texteditorcontrol":12:{s:4:"cols";i:60;s:4:"rows";i:8;s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:0;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:8:"maxchars";i:0;s:10:"identifier";s:7:"message";s:7:"caption";s:7:"Message";}';
                    $control->rank = 3;
                    $db->insertObject($control, 'formbuilder_control');
                    @$this->msg['migrated'][$iloc->mod]['count']++;
                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                }
                break;
            case 'youtubemodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "youtube";
                if ($db->countObjects('youtube', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'youtubemodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'youtubemodule';
                $videos = $old_db->selectArrays('youtube', "location_data='" . serialize($iloc) . "'");
                if ($videos) {
                    foreach ($videos as $vi) {
                        unset($vi['id']);
                        $video = new youtube($vi);
                        $loc = expUnserialize($vi['location_data']);
                        $loc->mod = "youtube";
                        $video->title = $vi['name'];
                        if (empty($video->title)) {
                            $video->title = 'Untitled';
                        }
                        $video->location_data = serialize($loc);
                        $yt = explode("watch?v=", $vi['url']);
                        if (empty($yt[1])) {
                            break;
                        } else {
                            $ytid = $yt[1];
                        }
                        unset($video->url);
                        $video->embed_code = '<iframe title="YouTube video player" width="' . $vi['width'] . '" height="' . $vi['height'] . '" src="http://www.youtube.com/embed/' . $ytid . '" frameborder="0" allowfullscreen></iframe>';
                        $video->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'mediaplayermodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "flowplayer";
                if ($db->countObjects('flowplayer', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'mediaplayermodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'mediaplayermodule';
                $movies = $old_db->selectArrays('mediaitem', "location_data='" . serialize($iloc) . "'");
                if ($movies) {
                    foreach ($movies as $mi) {
                        unset($mi['id']);
                        $movie = new flowplayer($mi);
                        $loc = expUnserialize($mi['location_data']);
                        $loc->mod = "flowplayer";
                        $movie->title = $mi['name'];
                        if (empty($movie->title)) {
                            $movie->title = 'Untitled';
                        }
                        unset($mi['bgcolor']);
                        unset($mi['alignment']);
                        unset($mi['loop_media']);
                        unset($mi['auto_rewind']);
                        unset($mi['autoplay']);
                        unset($mi['hide_controls']);
                        $movie->location_data = serialize($loc);
                        $movie->poster = 1;
                        $movie->rank = 1;
                        if (!empty($mi['media_id'])) {
                            $movie->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                            $file = new expFile($mi['media_id']);
                            $movie->attachitem($file, 'video');
                            if (!empty($mi['alt_image_id'])) {
                                $file = new expFile($mi['alt_image_id']);
                                $movie->attachitem($file, 'splash');
                            }
                        }
                    }
                }
                break;
            case 'bannermodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "banner";
                if ($db->countObjects('banner', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'bannermodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'bannermodule';
                $banners = $old_db->selectArrays('banner_ad', "location_data='" . serialize($iloc) . "'");
                if ($banners) {
                    foreach ($banners as $bi) {
                        $oldclicks = $old_db->selectObjects('banner_click', "ad_id='" . $bi['id'] . "'");
                        $oldcompany = $old_db->selectObject('banner_affiliate', "id='" . $bi['affiliate_id'] . "'");
                        unset($bi['id']);
                        $banner = new banner($bi);
                        $loc = expUnserialize($bi['location_data']);
                        $loc->mod = "banner";
                        $banner->title = $bi['name'];
                        $banner->url = !empty($bi['url']) ? $bi['url'] : '#';
                        if (empty($banner->title)) {
                            $banner->title = 'Untitled';
                        }
                        $banner->location_data = serialize($loc);
                        $newcompany = $db->selectObject('companies', "title='" . $oldcompany->name . "'");
                        if ($newcompany == null) {
                            $newcompany = new company();
                            $newcompany->title = !empty($oldcompany->name) ? $oldcompany->name : 'Untitled';
                            $newcompany->body = $oldcompany->contact_info;
                            $newcompany->location_data = $banner->location_data;
                            $newcompany->save();
                        }
                        $banner->companies_id = $newcompany->id;
                        $banner->clicks = 0;
                        foreach ($oldclicks as $click) {
                            $banner->clicks += $click->clicks;
                        }
                        if (!empty($bi['file_id'])) {
                            $file = new expFile($bi['file_id']);
                            $banner->attachitem($file, '');
                        }
                        $banner->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'addressbookmodule':
                // user mod, not widely distributed
                @($module->view = 'myaddressbook');
                @($module->action = 'myaddressbook');
                //check to see if it's already pulled in (circumvent !is_original)
                // $ploc = $iloc;
                // $ploc->mod = "addresses";
                // if ($db->countObjects($ploc->mod, "location_data='".serialize($ploc)."'")) {
                // $iloc->mod = 'addressbookmodule';
                // $linked = true;
                // break;
                // }
                //                $iloc->mod = 'addressbookmodule';
                $addresses = $old_db->selectArrays('addressbook_contact', "location_data='" . serialize($iloc) . "'");
                if ($addresses) {
                    foreach ($addresses as $address) {
                        //						unset($address['id']);
                        $addr = new address();
                        $addr->user_id = 1;
                        $addr->is_default = 1;
                        $addr->is_billing = 1;
                        $addr->is_shipping = 1;
                        $addr->firstname = !empty($address['firstname']) ? $address['firstname'] : 'blank';
                        $addr->lastname = !empty($address['lastname']) ? $address['lastname'] : 'blank';
                        $addr->address1 = !empty($address['address1']) ? $address['address1'] : 'blank';
                        $addr->city = !empty($address['city']) ? $address['city'] : 'blank';
                        $address['state'] = !empty($address['state']) ? $address['state'] : 'CA';
                        $state = $db->selectObject('geo_region', 'code="' . strtoupper($address['state']) . '"');
                        $addr->state = $state->id;
                        $addr->zip = !empty($address['zip']) ? $address['zip'] : '99999';
                        $addr->phone = !empty($address['phone']) ? $address['phone'] : '800-555-1212';
                        $addr->email = !empty($address['email']) ? $address['email'] : '*****@*****.**';
                        $addr->organization = $address['business'];
                        $addr->phone2 = $address['cell'];
                        $addr->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'feedlistmodule':
                @($module->view = 'showall');
                $iloc->mod = 'feedlistmodule';
                $feedlist = $old_db->selectObject('feedlistmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($feedlist->enable_rss == 1) {
                    $loc = expUnserialize($feedlist->location_data);
                    $loc->mod = "rssController";
                    $config['enable_rss'] = true;
                    $config['feed_title'] = $feedlist->feed_title;
                    $config['feed_desc'] = $feedlist->feed_desc;
                    $config['rss_limit'] = isset($feedlist->rss_limit) ? $feedlist->rss_limit : 24;
                    $config['rss_cachetime'] = isset($feedlist->rss_cachetime) ? $feedlist->rss_cachetime : 1440;
                    $newconfig = new expConfig();
                    $newconfig->config = $config;
                    $newconfig->location_data = $loc;
                    $newconfig->save();
                    $newrss = new expRss();
                    $newrss->module = $loc->mod;
                    $newrss->src = $loc->src;
                    $newrss->enable_rss = $feedlist->enable_rss;
                    $newrss->feed_title = $feedlist->feed_title;
                    $newrss->feed_desc = $feedlist->feed_desc;
                    $newrss->rss_limit = isset($feedlist->rss_limit) ? $feedlist->rss_limit : 24;
                    $newrss->rss_cachetime = isset($feedlist->rss_cachetime) ? $feedlist->rss_cachetime : 1440;
                    $newrss->save();
                    @$this->msg['migrated'][$iloc->mod]['count']++;
                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                }
                break;
            default:
                @$this->msg['noconverter'][$iloc->mod]++;
                break;
        }
        // quick check for non hard coded modules
        // We add a container if they're not hard coded.
        !$hc ? $this->add_container($iloc, $module, $linked) : "";
        return $module;
    }
示例#12
0
<?php

header('Content-Type: text/html; charset=UTF-8');
require_once 'class/class_login.php';
$blog = new blog();
if (isset($_POST['grabar']) and $_POST['grabar'] == 'si') {
    $blog->nueva_sesion();
} else {
}
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Registro de usuarios</title>
    </head>
    <body>
        <form name="form" action="" method="post">
        <table style="width:400px; height:120px; background:#FFCC00">
            <tr>
                <td>
                   Nombre de usuario 
                </td>
                <td>
                   <input type="text" name="nom"> 
                </td>
            </tr>
               <tr><input type="hidden" name="grabar" value="si">
                <td>
                    Password
                </td>
                <td>
示例#13
0
    ?>
						<li><?php 
    echo $category->link();
    ?>
</li>
					<?php 
}
?>
				</ul>
			</div>
			
			<div id="latest-blog-entry-synopsis" class="box">
				<h2>Recent Blog Posts</h2>
				<div class="padd-me">
					<?php 
echo blog::latest_entry_synopsis();
?>
<br />
					<?php 
echo html::anchor('blog', 'Read More');
?>
				</div>
			</div>
			
			<div id="shopping-cart-side-bar" class="box">
				<?php 
echo View::factory('carts/index');
?>
			</div>
		</div>
		
示例#14
0
文件: mediabox.php 项目: hshoghi/cms
<?php 
if ($media_item) {
    $aql = "blog_article{\n\t\t\t\ttitle,\n\t\t\t\tintroduction,\n\t\t\t\tmedia_item_id as article__media_item_id\n\t\t\t}\n\t\t\tblog_media\t{\n\t\t\t\t\t\t\tmedia_item_id as blog_media__media_item_id\n\t\t\t\t\t\t}\n\t\t\tblog_article_tag{\n\t\t\t\tname\n\t\t\t\twhere blog_media.blog_article_id = {$blog_article_id}\n\t\t\t\t\tand blog_media.type = 'mebox'\n\t\t\t\torder by iorder asc\n\t\t\t\tlimit 1\n\t\t\t}";
    $rs = aql::select($aql);
}
$settingss = array("transition" => "fade", "duration" => 4000, "height" => 322, "width" => 640, "height_small" => 62, "width_small" => 90);
?>
<fieldset>
	<legend>Mediabox Preview</legend>
<?php 
if ($rs) {
    $rs[0]['media_item_id'] = $rs[0]['blog_media__media_item_id'] ? $rs[0]['blog_media__media_item_id'] : $rs[0]['article__media_item_id'];
    $aql = "blog_media {\n                media_item_id\n                where blog_media.blog_article_id = {$rs[0]['blog_article_id']}\n                and type = 'tnail'\n                limit 1\n            }";
    $thumb = aql::select($aql);
    $rs[0]['thumb__media_item_id'] = $thumb[0]['media_item_id'] ? $thumb[0]['media_item_id'] : $rs[0]['media_item_id'];
    blog::marquee($rs, $settingss);
} else {
    echo "No images have been uploaded yet";
}
?>

</fieldset>
<ul class="contextMenu" id="imageContextMenu">
	<li>
		<a href="#set_article">Add to article</a>
	</li>
	<li>
		<a href="#delete">Delete</a>
	</li>
</ul>
示例#15
0
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR      //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,        //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,   //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE   //
// SOFTWARE.                                                                       //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
require_once '../../classes/common.class.php';
require_once '../../classes/account.class.php';
require_once '../../classes/blog.class.php';
$common = new common();
$account = new account();
$blog = new blog();
// Check if the user is logged in.
if (!$account->isAuthenticated()) {
    // The user is not logged in so forward them to the login page.
    header("Location: login.php");
}
// Get titles and dates for all blog posts.
$allPosts = $blog->getAllPosts();
// Pagination.
$itemsPerPage = 10;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$posts = $common->paginateArray($allPosts, $page, $itemsPerPage - 1);
////////////////
// BEGIN HTML
require_once '../includes/header.inc.php';
?>
示例#16
0
<?php

/**
* Main file
*
* @package Blog RSS Feed
* @version 1.0.3
* @copyright (c) 2010, 2011, 2012 phpBB Blog Team
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License v2
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'includes/mods/functions_blog.' . $phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/blog');
if ($config['blog_rss_feed_on']) {
    $feed = blog::getrssfeed();
} else {
    $feed = $user->lang['FEED_DISABLED'];
}
echo $feed;
示例#17
0
<?php

if (!defined('INCLUDED')) {
    die("Access Denied");
}
$category = $category_blog->lists();
include_once 'class/class_blog.php';
$blogs = new blog();
?>
<div class="content-menu" style="min-height: 0px;">
<?php 
if (count($category) > 0) {
    foreach ($category as $category) {
        $count = $blogs->lists('title', 'category_id = ' . $category->id);
        $n = count($count);
        ?>
<div class="link-menu">
						<div class="link-menu-img"><img src="<?php 
        echo $sitelink;
        ?>
/images/icon-menu-type.gif"/></div>
						<div class="link-menu-text">							
							<a  href="<?php 
        echo $sitelink;
        ?>
/advice-center/<?php 
        echo urlencode(clear($category->name));
        ?>
/index.htm"><?php 
        echo $category->name . ' (' . $n . ')';
        ?>
示例#18
0
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR      //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,        //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,   //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE   //
// SOFTWARE.                                                                       //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "account.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "blog.class.php";
$common = new common();
$account = new account();
$blog = new blog();
// Check if the user is logged in.
if (!$account->isAuthenticated()) {
    // The user is not logged in so forward them to the login page.
    header("Location: login.php");
}
if ($common->postBack()) {
    // Delete the selected blog post.
    $blog->deletePostByTitle(urldecode($_GET['title']));
    // Forward the user to the blog management index page.
    header("Location: /admin/blog/");
}
// Get titles and dates for all blog posts.
$post = $blog->getPostByTitle(urldecode($_GET['title']));
////////////////
// BEGIN HTML
示例#19
0
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR      //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,        //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,   //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE   //
// SOFTWARE.                                                                       //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "account.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "blog.class.php";
$common = new common();
$account = new account();
$blog = new blog();
// Check if the user is logged in.
if (!$account->isAuthenticated()) {
    // The user is not logged in so forward them to the login page.
    header("Location: login.php");
}
// Set updated variable to FALSE.
$updated = FALSE;
if ($common->postBack()) {
    // Update the contents of the blog post.
    $blog->editContentsByTitle($_POST['originalTitle'], $_POST['contents']);
    // Set updated to TRUE since settings were updated.
    $updated = TRUE;
}
// Get titles and dates for all blog posts.
$post = $blog->getPostByTitle(urldecode($_GET['title']));
示例#20
0
<?php

$sql = " select distinct blog_article_id,blog_article.title,blog.name,\n                blog_article.post_time, blog.slug as blog_slug,\n                market.slug as market_slug, blog_article_tag.iorder, blog_article.content,\n                blog_article.media_item_id, person.fname, person.lname, person.username\n        from blog_article_tag\n        left join blog_article on blog_article_id=blog_article.id\n        left join blog on blog_article.blog_id = blog.id\n        left join blog_website on blog.id=blog_website.blog_id\n        left join market on blog_article.market_id=market.id\n        left join person on blog_article.author__person_id=person.id\n        where blog_website.status='A'\n        and blog_website.website_id={$website_id}\n        and lower(blog_article_tag.name) ilike lower('{$current_tag}')\n        and blog_article_tag.active=1 and blog_article.active=1\n        and blog_article.status='A'\n        order by blog_article.post_time desc,blog_article_tag.iorder asc\n        limit {$limit}\n        offset {$offset}";
$rs = sql($sql);
echo "<div id='tag-blog-article-results'>";
if ($rs->EOF) {
    $last_page = true;
    include 'noresult.php';
} else {
    $articles = array();
    while (!$rs->EOF) {
        $articles[] = $rs->fields;
        $rs->MoveNext();
    }
    $last_page = count($articles) <= $num_per_page;
    while (count($articles) > $num_per_page) {
        array_pop($articles);
    }
    blog::listing(NULL, NULL, NULL, $articles);
}
echo "</div>";
示例#21
0
&nbsp;
               <?php 
    echo $blog_author['lname'] ? $blog_author['lname'] : $rs_person[0]['lname'];
    ?>
           </div>
 
           <div class="field">
               <label class="label">Email Address</label>
               <?php 
    echo $blog_author['email_address'] ? $blog_author['email_address'] : $rs_person[0]['email_address'];
    ?>
           </div>
		
           <?php 
    $page_views_carear = blog::get_pageviews('person', $blog_author['person_id']);
    $page_views_article = blog::get_pageviews('blog_article', array('where' => "where author__person_id={$blog_author['person_id']}"));
    ?>

           <fieldset><legend>Page View Stats</legend>
              <label class='label'>Carear</label>
              Hits: <?php 
    echo $page_views_carear['sum'];
    ?>
<br />
              Hits per article: <?php 
    echo $page_views_carear['ratio'];
    ?>
<br />
              <br /> 
              <label class='label'>Top 20 Articles</label>
              <?php 
示例#22
0
/**
* controller
*
* @author     Dac Chartrand <*****@*****.**>
* @license    http://www.fsf.org/licensing/licenses/gpl-3.0.html
*/
function sux($action, $params = null)
{
    switch ($action) {
        case 'admin':
            // --------------------------------------------------------------------
            // Admin
            // --------------------------------------------------------------------
            $admin = new blogAdmin();
            if ($admin->formValidate($_POST)) {
                $admin->formProcess($_POST);
                $admin->formSuccess();
            } else {
                $admin->formBuild($_POST);
            }
            break;
        case 'edit':
            // --------------------------------------------------------------------
            // Edit
            // --------------------------------------------------------------------
            $id = !empty($params[0]) ? $params[0] : null;
            $edit = new blogEdit($id);
            if ($edit->formValidate($_POST)) {
                $edit->formProcess($_POST);
                $edit->formSuccess();
            } else {
                $edit->formBuild($_POST);
            }
            break;
        case 'bookmarks':
            // --------------------------------------------------------------------
            // Scan for bookmarks
            // --------------------------------------------------------------------
            if (empty($params[0]) || !filter_var($params[0], FILTER_VALIDATE_INT)) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $bm = new blogBookmarks($params[0]);
            if ($bm->formValidate($_POST)) {
                $bm->formProcess($_POST);
                $bm->formSuccess();
            } else {
                $bm->formBuild($_POST);
            }
            break;
        case 'reply':
            // --------------------------------------------------------------------
            // Reply
            // --------------------------------------------------------------------
            if (empty($params[0]) || !filter_var($params[0], FILTER_VALIDATE_INT)) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $reply = new blogReply($params[0]);
            if ($reply->formValidate($_POST)) {
                $reply->formProcess($_POST);
                $reply->formSuccess();
            } else {
                $reply->formBuild($_POST);
            }
            break;
        case 'view':
            // --------------------------------------------------------------------
            // View
            // --------------------------------------------------------------------
            if (empty($params[0]) || !filter_var($params[0], FILTER_VALIDATE_INT)) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $blog = new blog();
            $blog->view($params[0]);
            break;
        case 'author':
            // --------------------------------------------------------------------
            // Author
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $blog = new blog();
            $blog->author($params[0]);
            break;
        case 'tag':
            // --------------------------------------------------------------------
            // Tag
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $blog = new blog();
            if ($params[0] == 'cloud') {
                $blog->tagcloud();
            } else {
                $blog->tag($params[0]);
            }
            break;
        case 'category':
            // --------------------------------------------------------------------
            // Category
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/blog'));
            }
            $blog = new blog();
            $blog->category($params[0]);
            break;
        case 'month':
            // --------------------------------------------------------------------
            // Month
            // --------------------------------------------------------------------
            $date = !empty($params[0]) ? $params[0] : date('Y-m-d');
            $blog = new blog();
            $blog->month($date);
            break;
        case 'rss':
            // --------------------------------------------------------------------
            // RSS
            // --------------------------------------------------------------------
            $blog = new blog();
            $blog->rss();
            break;
        default:
            // --------------------------------------------------------------------
            // Default
            // --------------------------------------------------------------------
            $blog = new blog();
            $blog->listing();
            break;
    }
}
示例#23
0
$cards_int = new cards_int();
include_once 'class/class_cards_bank.php';
$cards_bank = new cards_bank();
include_once 'class/class_cards_report.php';
$cards_report = new cards_report();
include_once 'class/class_block.php';
$block = new block();
include_once 'class/class_user.php';
$user = new user();
//*
include_once 'class/class_category_blog.php';
include_once 'class/class_comment_blog.php';
$category_blog = new category_blog();
$comment_blog = new comment_blog();
include_once 'class/class_blog.php';
$blogs = new blog();
//*/
include_once 'class/class_support.php';
$support = new support();
include_once 'class/class_news.php';
$news = new news();
include_once 'class/class_channel_pro.php';
$channel_pro = new channel_pro();
include_once 'class/class_category_pro.php';
$category_pro = new category_pro();
include_once 'class/class_channel_news.php';
$channel_news = new channel_news();
include_once 'class/class_category_news.php';
$category_news = new category_news();
include_once 'class/class_product.php';
$product = new product();
示例#24
0
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR      //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,        //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,   //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE   //
// SOFTWARE.                                                                       //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
require_once '../../classes/common.class.php';
require_once '../../classes/account.class.php';
require_once '../../classes/blog.class.php';
$common = new common();
$account = new account();
$blog = new blog();
// Check if the user is logged in.
if (!$account->isAuthenticated()) {
    // The user is not logged in so forward them to the login page.
    header("Location: login.php");
}
$titleExists = FALSE;
if ($common->postBack()) {
    // Check if title already exists.
    $titleExists = $blog->titleExists($_POST['title']);
    if (!$titleExists) {
        // Update the contents of the blog post.
        $blog->addPost($_SESSION['login'], $_POST['title'], $_POST['contents']);
        // Forward the user to the blog management index page.
        header("Location: /admin/blog/");
    }
示例#25
0
<?php

/**
* @version   $Id$
* @package   Jumi
* @copyright Copyright (C) 2008 Edvard Ananyan. All rights reserved.
* @license   GNU/GPL, see LICENSE.php
*/
defined("_VALID_MOS") or die("Restricted access");
$blogId = isset($blogId) ? $blogId : '1748567850225926498';
$login = isset($login) ? $login : '******';
$cacheTime = isset($cacheTime) ? (int) $cacheTime : 86400;
$myBlog = new blog($blogId, $login, $cacheTime);
$myBlog->printAllPosts();
echo '<style type="text/css">
.post {margin:0 0 1.5em;font-family:Verdana,sans-serif;color:#000000;}
.post div {margin:0 0 .75em;line-height:1.3em;}
.post img {padding:4px;border:1px solid #cccccc;}
.post blockquote {margin:1em 20px;}
.post blockquote p {margin:.75em 0;}
.date-header {margin:1.5em 0 0;font-weight:normal;color:#999999;font-size:100%;}
.post-title {margin:0;padding:0;font-size:110%;font-weight:bold;line-height:1.1em;}
.post-title a, .post-title a:visited, .post-title strong {text-decoration:none;color:#333333;font-weight:bold;}
.post-footer {color:#333333;font-size:87%;}
.post-footer .span {margin-right:.3em;}
</style>';
class blog
{
    public $id;
    public $login;
    public $posts;
示例#26
0
OW_liste_document(array('type' => 'H'), 1, 'Humeur&#8230;');
?>
    <p class="tous"><a href="/humeurs/">Toutes les humeurs</a></p>
  </div>
  <!-- Fin Humeur -->

</div>
<!-- Fin Intro -->

<!-- Début Actualité -->
<div id="actualite">
  <h2>Actualité</h2>
<?php 
require_once 'dotclear/inc/prepend.php';
$con = new connection($dbuser, $dbpass, $dbhost, $dbbase);
$blog = new blog($con, DB_PREFIX, 1, dc_encoding);
$news = $blog->getLastNews(3, 'actualite');
if ($news->isEmpty()) {
    echo "  <p>Aucune actualité</p>\n";
} else {
    while (!$news->EOF()) {
        echo '  <h3>', $news->f('post_titre'), "</h3>\n";
        echo '  <h4>', strftime('%x', strtotime($news->f('post_dt'))), "</h4>\n";
        echo '  ', $news->f('post_content'), "\n\n";
        $news->moveNext();
    }
}
$con->close();
?>
  <p class="tous"><a href="/actualite/">Toutes les actualités</a></p>
</div>
示例#27
0
$allgemein = new functions();
$suche = isset($_GET['suche']) ? $_GET['suche'] : '';
echo $allgemein->suche($suche, "blogtexte", "titel", "?showblogid");
?>
<title>Forum - Thema anzeigen</title>
	</head>
	<body>
		<div class='mainbodyDark'>			
			<?php 
# zeigt Navigation an
$blog->showForumNav();
# $blogid = (isset($_GET['showblogid'])) ? $_GET['showblogid'] : '';
$bearbid = isset($_GET['bearbid']) ? $_GET['bearbid'] : '';
$blogid = isset($_GET['showblogid']) ? $_GET['showblogid'] : '';
$loeschid = isset($_GET['loeschid']) ? $_GET['loeschid'] : '';
$selectContentForBlog = new blog();
if ($blog->userHasRight("20", 0) == true) {
    $selectContentForBlog->bearbBlogId($bearbid);
    $selectContentForBlog->deleBlogId($loeschid);
}
if (!isset($_GET['bearbid'])) {
    #	$bearbid = (isset($_GET['loeschid'])) ? $_GET['loeschid'] : '';
    $selectContentForBlog->showBlogId($blogid);
}
# zeigt Navigation an
$blog->showForumNav();
?>
			
		</div>

	</body>
示例#28
0
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR      //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,        //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,   //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE   //
// SOFTWARE.                                                                       //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
require_once '../../classes/common.class.php';
require_once '../../classes/account.class.php';
require_once '../../classes/blog.class.php';
$common = new common();
$account = new account();
$blog = new blog();
// Check if the user is logged in.
if (!$account->isAuthenticated()) {
    // The user is not logged in so forward them to the login page.
    header("Location: login.php");
}
// Get titles and dates for all blog posts.
$allPosts = $blog->getTitlesAndDates();
// Pagination.
$itemsPerPage = 10;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$posts = $common->paginateArray($allPosts, $page, $itemsPerPage - 1);
////////////////
// BEGIN HTML
require_once '../includes/header.inc.php';
?>
示例#29
0
 }
 if (empty($_POST['catID'])) {
     $error[] = 'Please select the category of the blog.';
 }
 if (count($postDesc) > 255) {
     $error[] = 'The description can only be 255 characters or less.';
 }
 if ($postCont == '') {
     $error[] = 'Please enter the content.';
 }
 if (!isset($error)) {
     try {
         if ($user->is_logged_in()) {
             // Process the image
             include_once "../classes/class/blog.php";
             $blog = new blog();
             $imagesDir = "../images/";
             $photoName = $_FILES['photoFilename']["name"];
             $tmpName = $_FILES['photoFilename']["tmp_name"];
             $fileType = $_FILES['photoFilename']["type"];
             $fullPath = $imagesDir . $photoName;
             // Save the image to the relevant directory
             $targetPath = $imagesDir . basename($_FILES['photoFilename']['name']);
             if (move_uploaded_file($tmpName, $targetPath) || empty($_POST['photoFilename'])) {
                 // If the picture is empty, point to a default image
                 if ($_FILES['photoFilename']['error'] == 4) {
                     $photoName = "empty";
                 }
                 // Get the slug for this page
                 $postSlug = slug($postTitle);
                 // Insert the blog into the database
示例#30
0
文件: blog.php 项目: ygres/sblog
 function addCat()
 {
     system::setParam("page", "addCat");
     if (!empty($_POST)) {
         if (blog::addCat($_POST)) {
             system::redirect("/adm/blog/categories");
         }
     }
 }