Пример #1
0
 public function edit_toggle()
 {
     if (!empty($this->params['id'])) {
         $faq = new faq($this->params['id']);
         $faq->include_in_faq = empty($faq->include_in_faq) ? 1 : 0;
         $faq->save();
     }
     expHistory::back();
 }
Пример #2
0
 /**
  * Public function that creates a single instance
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Пример #3
0
 public function command_faqadd($user, $channel, $args)
 {
     echo $user;
     if (faq::isAllowed($user)) {
         $subject = $args[0];
         $this->bot->notice($user, "Added FAQ Entry for " . $subject . ".");
         $fp = fopen("faq/" . ucwords(strtolower($subject)) . ".txt", "a");
         fwrite($fp, $subject . ": " . implode(" ", array_splice($args, 1)) . "\r\n");
         fclose($fp);
     } else {
         $this->bot->notice($user, "You are not authorised to add FAQ Entrys");
     }
 }
Пример #4
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $insert = $request->all();
     $safeName = false;
     //upload image
     if ($file = Input::file('image')) {
         $fileName = $file->getClientOriginalName();
         $extension = $file->getClientOriginalExtension() ?: 'png';
         $folderName = '/uploads/';
         $destinationPath = Config::get('app.path') . $folderName;
         $safeName = time() . "_" . str_random(10) . '.' . $extension;
         $file->move($destinationPath, $safeName);
         $insert['image'] = $safeName ? $folderName . $safeName : '';
     }
     if (isset(Faq::$boolean)) {
         foreach (faq::$boolean as $field) {
             if (isset($insert[$field]) && $insert[$field] == "on") {
                 $insert[$field] = 1;
             }
         }
     }
     faq::create($insert);
     return redirect('admin/faqs')->with('success', Lang::get('message.success.create'));
 }
Пример #5
0
    if ($_POST['faq_question'] != "" || $_POST['data'] != "") {
        $faq_question = $aj->formtpa($_POST['faq_question'], "on");
        $data = $aj->formtpa($_POST['data'], "on");
        $sql->db_Update("faqs", "faq_parent='" . $_POST['faq_parent'] . "', faq_question ='{$faq_question}', faq_answer='{$data}', faq_comment='" . $_POST['faq_comment'] . "'  WHERE faq_id='" . $idx . "' ");
        $message = FAQ_ADLAN_29;
        unset($faq_question, $data);
    } else {
        $message = FAQ_ADLAN_30;
    }
}
if (isset($_POST['commentsubmit'])) {
    $pid = isset($_POST['pid']) ? $_POST['pid'] : 0;
    $cobj->enter_comment($_POST['author_name'], $_POST['comment'], "faq", $idx, $pid, $_POST['subject']);
}
// Actions +++++++++++++++++++++++++++++
$faq = new faq();
$faqpref = e107::getPlugConfig('faqs')->getPref();
if ($action == "" || $action == "main") {
    if (vartrue($faqpref['classic_look'])) {
        $ftmp = $faq->show_existing_parents($action, $sub_action, $id, $from, $amount);
        $caption = FAQLAN_41;
    } else {
        $srch = vartrue($_GET['srch']);
        $ftmp = $faq->view_all($srch);
        $caption = FAQLAN_FAQ;
    }
    $pageTitle = '';
    //	define("e_PAGETITLE", $ftmp['caption']);
    if (vartrue($faqpref['page_title'])) {
        $pageTitle = $faqpref['page_title'][e_LANGUAGE];
    } else {
Пример #6
0
 $adresse = str_replace("!!common_tpl_address!!", $msg["common_tpl_address"], $adresse);
 $adresse = str_replace("!!common_tpl_contact!!", $msg["common_tpl_contact"], $adresse);
 if ($lvl == "more_results") {
     $facette = str_replace("!!title_block_facette!!", $msg["label_title_facette"], $facette);
     $facette = str_replace("!!lst_facette!!", $str, $facette);
     $lvl1 = str_replace("!!lst_lvl1!!", $str_lvl1, $lvl1);
 } else {
     if (strpos($lvl, "_see") !== false && $lvl != "section_see") {
         $facette = str_replace("!!title_block_facette!!", $msg["label_title_facette"], $facette);
         $facette = str_replace("!!lst_facette!!", $str, $facette);
         $lvl1 = "";
     } else {
         if ($lvl == "faq") {
             //au plus simple...
             if (!is_object($faq) || get_class($faq) != "faq") {
                 $faq = new faq($faq_page, 0, $faq_filters);
             }
             $facette = $faq->get_facettes_filter();
             $lvl1 = "";
         } else {
             $facette = "";
             $lvl1 = "";
         }
     }
 }
 // loading the languages available in OPAC - martizva >> Eric
 require_once $base_path . '/includes/languages.inc.php';
 $home_on_left = str_replace("!!common_tpl_lang_select!!", show_select_languages("index.php"), $home_on_left);
 if (!$_SESSION["user_code"]) {
     $loginform = str_replace('<!-- common_tpl_login_invite -->', $msg["common_tpl_login_invite"], $loginform);
     $loginform__ = genere_form_connexion_empr();
Пример #7
0
*/
Route::get('/hello', function () {
    return View::make('test');
});
Route::get('/', function () {
    return View::make('index');
    Session::forget('keywords');
    Session::forget('title');
});
Route::get('/contact-us', function () {
    Session::flash('keywords', 'contact us');
    Session::flash('title', 'Contact us');
    return View::make('contact');
});
Route::get('/faq', function () {
    $faqs = faq::all();
    //return $faqs;
    Session::flash('keywords', 'faq, questions, queries');
    Session::flash('title', 'FAQ');
    return View::make('faqs', compact('faqs'));
});
Route::get('/page/{slug}', function ($slug) {
    $content = Page::where('slug', $slug)->first();
    Session::flash('keywords', $content->heading);
    Session::flash('title', $content->heading);
    return View::make('page', compact('content'));
});
//users
Route::controller('users', 'UsersController', array('getLogin' => 'users.login', 'getResend' => 'users.resend'));
Route::any('usernameCheck', function () {
    return View::make('usernameCheck');
Пример #8
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: faq.inc.php,v 1.1 2014-04-02 12:29:07 arenou Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
// afin de résoudre un pb d'effacement de la variable $id_empr par empr_included, bug à trouver
if (!$id_empr) {
    $id_empr = $_SESSION["id_empr_session"];
}
switch ($lvl) {
    case "faq":
        require_once $class_path . "/faq.class.php";
        $faq = new faq($faq_page, 0, $faq_filters);
        print $faq->show();
        break;
    case "question":
        break;
}
Пример #9
0
#添加FAQ条目
if (check_login_bool() && $item['user_id'] == $_SESSION['user']['user_id'] && isset($_POST['add'])) {
    $faqClass = new faq();
    $s = $faqClass->add($itemID);
    if ($s === true) {
        refresh('/' . $languageURL . 'items/faq/' . $itemID . '/', $langArray['complete_add_faq'], 'complete');
    } else {
        $message = '<ul>';
        foreach ($s as $e) {
            $message .= '<li>' . $e . '</li>';
        }
        $message .= '</ul>';
        addErrorMessage($message, '', 'error');
    }
}
$faqClass = new faq();
if (check_login_bool() && $item['user_id'] == $_SESSION['user']['user_id'] && isset($_GET['del']) && is_numeric($_GET['del'])) {
    $faqClass->delete($_GET['del'], $itemID);
    refresh('/' . $languageURL . 'items/faq/' . $itemID . '/', $langArray['complete_delete_faq'], 'complete');
}
#加载FAQ
$faq = $faqClass->getAll($itemID);
abr('faq', $faq);
#标签标记作品
require_once ROOT_PATH . '/apps/items/controllers/bookmark.php';
#是否免费文件
if ($item['free_file'] == 'true') {
    abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id'])));
}
#加载其它作品
$otherItems = $itemsClass->getAll(0, 6, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' AND `user_id` = '" . intval($item['user_id']) . "' ", "RAND()");
Пример #10
0
$category_news = new category_news();
include_once 'class/class_product.php';
$product = new product();
include_once 'includes/class_template.php';
$template = new template();
include_once 'class/class_menu.php';
$menu = new menu();
include_once 'class/class_order.php';
$order = new order();
include_once 'class/class_advertise.php';
$advertise = new advertise();
include_once 'class/class_contact.php';
$contact = new contact();
if ($module == 'faq') {
    include_once 'class/class_faq.php';
    $faq = new faq();
}
if ($module == 'glossary') {
    include_once 'class/class_glossary.php';
    $glossary = new glossary();
}
if ($module == 'product') {
    include_once 'class/class_comment_pro.php';
    $com_pro = new comment_pro();
}
// include lang?gage
$file_lang = $config->get_lang();
if (is_file('language/' . $file_lang . '.php')) {
    include_once 'language/' . $file_lang . '.php';
    include_once 'language/product' . $file_lang . '.php';
    include_once 'language/order' . $file_lang . '.php';
Пример #11
0
<?php

$filename = 'blocks/' . $directory . '/templates/top.tpl.php';
$file = fopen($filename, "r") or die("Can't open file!");
$boxlet_content = fread($file, filesize($filename));
fclose($file);
$questions = faq::get_questions();
if ($questions > 0) {
    for ($z = 0; $z < count($questions); $z++) {
        $filename = 'blocks/' . $directory . '/templates/question.tpl.php';
        $file = fopen($filename, "r") or die("Can't open file!");
        $boxlet_content = $boxlet_content . fread($file, filesize($filename));
        fclose($file);
        $quest = strip_tags($questions[$z]['question']);
        $boxlet_content = str_replace('[question]', $quest, $boxlet_content);
        $link = 'faq#q' . $questions[$z]['id'];
        $boxlet_content = str_replace('[link]', $link, $boxlet_content);
    }
}
$boxlet_content = str_replace('[title]', $name, $boxlet_content);
Пример #12
0
/**
 * FAQ page
 * @author Rene F. Gabriel Junior <*****@*****.**>
 * @author Rene Faustino Gabriel Junior  (Analista-Desenvolvedor)
 * @copyright © Pan American Health Organization, 2013. All rights reserved.
 * @access public
 * @version v0.13.46
 * @package ProEthos
 * @subpackage FAQ
 */
/* mark active page to cabmenu */
$active_page = 'faq';
$nosec = 1;
require "cab.php";
require '_class/_class_faq.php';
$faq = new faq();
$faq->faq_seccao = 'CEP';
/* Mensagens do sistema */
global $messa;
$file = '../messages/msg_faq.php';
if (file_exists($file)) {
    require $file;
}
/* Sess�o e pagina da Submissao */
echo '<H1>' . msg('faq_title') . '</h1>';
echo '<fieldset><legend>' . msg('faq') . '</legend>';
echo '<Table width="' . $tab_max . '" class="lt1" align="center" >';
echo '<TR><TD>';
echo $faq->faq();
echo '</table>';
echo '</fieldset>';
Пример #13
0
require 'cab.php';
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
require '_class/_class_faq.php';
$ln = new message();
global $acao, $dd, $cp, $tabela;
require $include . 'sisdoc_colunas.php';
require $include . '_class_form.php';
$form = new form();
require "form_css.php";
require $include . 'sisdoc_data.php';
require $include . 'sisdoc_debug.php';
$cl = new faq();
$cp = $cl->cp();
$tabela = $cl->tabela;
$http_edit = $tabela . '_ed.php';
$http_redirect = '';
$tit = msg("tit" . $tabela);
/** Comandos de Edicao */
echo '<CENTER><h2>' . $tit . '</h2></CENTER>';
$tela = $form->editar($cp, $form);
echo '</div>';
/** Caso o registro seja validado */
if ($saved > 0) {
    echo 'Salvo';
    $cl->updatex();
    redirecina($tabela . '.php');
} else {
Пример #14
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;
    }
Пример #15
0
<?php

$back_names[] = "cl_call";
$faq = new faq();
$faq->mysqli = $this->mysqli;
$js_functions[] = $faq->show_js();
$string_out .= "<div id='action_buttons' class='divactionbuttons'>" . $faq->faq_buttons() . "</div>";
$string_out .= "<div class='bigblock' id='bigblock'>\n<div class='bigblockcontent' id='bigblockcontent'>\n<div id='main_div' class='content'>\n" . $faq->show_warnings() . "\n</div>\n</div>\n</div>";
Пример #16
0
if (!defined('PATHOS')) {
    exit('');
}
$qna = null;
if (isset($_GET['id'])) {
    $qna = $db->selectObject('faq', 'id=' . $_GET['id']);
    if ($qna != null) {
        $loc = unserialize($qna->location_data);
    }
}
if (pathos_permissions_check('manage', $loc)) {
    $config = $db->selectObject('faqmodule_config', "location_data='" . serialize($loc) . "'");
    if ($config == null) {
        $config->enable_categories = 0;
    }
    $form = faq::form($qna);
    $form->location($loc);
    $form->meta('action', 'save_faq');
    $template = new template('faqmodule', '_form_editfaq', $loc);
    if ($config->enable_categories) {
        $allcats = $db->selectObjects('category', "location_data='" . serialize($loc) . "'");
        if (!defined('SYS_SORTING')) {
            require_once BASE . 'subsystems/sorting.php';
        }
        usort($allcats, 'pathos_sorting_byRankAscending');
        $catarray = array();
        foreach ($allcats as $cat) {
            $catarray[$cat->id] = $cat->name;
        }
        $form->registerBefore('question', 'categories', 'Select Category', new dropdowncontrol('', $catarray));
    }
Пример #17
0
 function __construct()
 {
     self::$baseC = new base();
 }
Пример #18
0
} elseif (isset($badges_data['system']['location_global_community']) && $badges_data['system']['location_global_community']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['location_global_community']['photo'])) {
    $user_badges[] = array('name' => $badges_data['system']['location_global_community']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['location_global_community']['photo']);
}
if ($user['power_elite_author'] == 'true' && isset($badges_data['system']['power_elite_author'])) {
    if ($badges_data['system']['power_elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['power_elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['power_elite_author']['photo']);
    }
}
if ($user['elite_author'] == 'true' && isset($badges_data['system']['elite_author'])) {
    if ($badges_data['system']['elite_author']['photo'] && file_exists(DATA_SERVER_PATH . "/uploads/badges/" . $badges_data['system']['has_been_featured']['photo'])) {
        $user_badges[] = array('name' => $badges_data['system']['elite_author']['name'], 'photo' => '/uploads/badges/' . $badges_data['system']['elite_author']['photo']);
    }
}
#获取粉丝
$follow['to'] = $usersClass->getFollowers($user['user_id'], 0, 9, 'RAND()', true);
$follow['to_count'] = $usersClass->foundRows;
$follow['from'] = $usersClass->getFollowers($user['user_id'], 0, 9, 'RAND()');
$follow['from_count'] = $usersClass->foundRows;
abr('follow', $follow);
$follow['toto'] = $usersClass->getFollowers($user['user_id'], 0, 10000000, 'RAND()', true);
$follow['toto_count'] = $usersClass->foundRows;
$follow['fromfrom'] = $usersClass->getFollowers($user['user_id'], 0, 10000000, 'RAND()');
$follow['fromfrom_count'] = $usersClass->foundRows;
abr('follow', $follow);
abr('user_badges', $user_badges);
abr('meta', $meta);
#FAQ
require_once ROOT_PATH . '/apps/items/models/faq.class.php';
$faqClass = new faq();
$faqs = $faqClass->CountAll($itemID);
abr('faqs', $faqs);
Пример #19
0
 * @access public
 * @version v0.13.46
 * @package ProEthos-Admin
 * @subpackage faq
 */
require "cab.php";
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
global $acao, $dd, $cp, $tabela;
require $include . 'sisdoc_colunas.php';
/* Dados da Classe */
require '_class/_class_faq.php';
$clx = new faq();
$cp = $clx->cp();
$tabela = $clx->tabela;
/* N�o alterar - dados comuns */
echo '<h1>' . msg('menu_faq') . '</h1>';
$http_edit = $tabela . '_ed.php';
//$http_ver = 'pibic_bolsa_tipo_detalhe.php';
$editar = True;
$http_redirect = $tabela . '.php';
$clx->row();
$busca = true;
$offset = 20;
//$pre_where = " e_mailing = '".$cl->mail_codigo."' ";
if ($order == 0) {
    $order = $cdf[3] . ' ,' . $cdf[2];
}
Пример #20
0
        $ordenSQL = "select id, pregunta, respuesta from faqs where publico = true order by orden";
        $result = $__BD->db_query($ordenSQL);
        $menu = '';
        $texto = '';
        while ($row = $__BD->db_fetch_array($result)) {
            $pregunta = $__LIB->traducir("faqs", "pregunta", $row["id"], $row["pregunta"]);
            $respuesta = $__LIB->traducir("faqs", "respuesta", $row["id"], $row["respuesta"]);
            $menu .= '<a href="general/faq.php#' . $row[0] . '">' . $pregunta . '</a><br/>';
            $texto .= '<a name="' . $row[0] . '"></a>';
            $texto .= '<h2>' . $pregunta . '</h2>';
            $texto .= nl2br($respuesta);
            $texto .= '<p><br/><a class="botLink" href="general/faq.php#home">' . _INICIO . '</a></p>';
        }
        echo $menu;
        echo $texto;
        echo '</div>';
    }
}
//// OFICIAL /////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
/** @main_class_definition oficial_faq */
class faq extends oficial_faq
{
}
$iface_faq = new faq();
$iface_faq->contenidos();
?>


<?php 
include "../includes/right_bottom.php";
Пример #21
0
if (isset($_POST['id'])) {
    $qna = $db->selectObject('faq', 'id=' . $_POST['id']);
    if ($qna != null) {
        $loc = unserialize($qna->location_data);
    }
} else {
    $qna->rank = $db->max('faq', 'rank', 'location_data', "location_data='" . serialize($loc) . "'");
    if ($qna->rank == null) {
        $qna->rank = 0;
    } else {
        $qna->rank += 1;
    }
}
if (pathos_permissions_check("manage", $loc)) {
    $oldcatid = $qna->category_id;
    $qna = faq::update($_POST, $qna);
    $qna->location_data = serialize($loc);
    if (isset($_POST['categories'])) {
        $qna->category_id = $_POST['categories'];
    }
    if (isset($qna->id)) {
        $db->updateObject($qna, "faq");
    } else {
        $db->insertObject($qna, "faq");
    }
    if ($oldcatid != $qna->category_id) {
        $db->decrement('faq', 'rank', 1, "location_data='" . serialize($loc) . "' AND rank > " . $qna->rank . " AND category_id=" . $qna->category_id);
    }
    pathos_flow_redirect();
} else {
    echo SITE_403_HTML;