Esempio n. 1
0
 function showList()
 {
     $mes = e107::getMessage();
     $sql = e107::getDb();
     $ns = e107::getRender();
     $tp = e107::getParser();
     $frm = e107::getForm();
     $gen = new convert();
     $count = $sql->select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_order ASC");
     if (!$count) {
         $text = "\n\t\t\t<form action='" . e_SELF . "?import' id='import' method='post'>\n\t\t\t" . GSLAN_39 . "<br /><br />" . $frm->admin_button('import', LAN_YES, 'submit') . "\n\t\t\t</form>";
         $mes->addInfo($text);
         $ns->tablerender(GSLAN_24, $mes->render());
         return;
     } else {
         $text = "\n\t\t\t<form action='" . e_SELF . "' id='display' method='post'>\n\t\t\t<table class='table adminlist'>\n            \t<colgroup span='2'>\n\t\t\t\t\t<col style='width:5%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:35%' />\n\t\t\t\t\t<col style='width:20%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t</colgroup>\n                <thead>\n\t\t\t\t<tr class='first last' >\n\t\t\t\t<th style='text-align: center;'>Id</th>\n\t\t\t\t<th>" . LAN_NAME . "</th>\n\t\t\t\t<th>" . LAN_URL . "</th>\n\t\t\t\t<th style='text-align: center'>" . GSLAN_27 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_28 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_9 . "</th>\n\t\t\t\t<th style='text-align: center'>" . LAN_OPTIONS . "</th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t";
         $glArray = $sql->db_getList();
         foreach ($glArray as $row2) {
             $datestamp = $gen->convert_date($row2['gsitemap_lastmod'], "short");
             $rowStyle = vartrue($rowStyle) == "odd" ? "even" : "odd";
             $text .= "<tr class='{$rowStyle}'>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_id'] . "</td>\n\t\t\t\t<td>" . $tp->toHTML($row2['gsitemap_name'], "", "defs") . "</td>\n\t\t\t\t<td>" . $row2['gsitemap_url'] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $datestamp . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $this->freq_list[$row2['gsitemap_freq']] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_priority'] . "</td>\n\n\t\t\t\t<td class='center' style='white-space:nowrap'>\n\t\t\t\t<div>\n\t\t\t\t<button class='btn btn-default' type='submit' name='edit[{$row2['gsitemap_id']}]' value='edit' alt='" . LAN_EDIT . "' title='" . LAN_EDIT . "' style='border:0px' >" . ADMIN_EDIT_ICON . "</button>\n\t\t\t\t<button class='btn btn-default action delete' type='submit' name='delete[{$row2['gsitemap_id']}]' value='del' data-confirm='" . $tp->toJS(LAN_CONFIRMDEL . " [" . $row2['gsitemap_name'] . "]") . "' title='" . LAN_DELETE . "' >" . ADMIN_DELETE_ICON . "</button>\n\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t";
         }
     }
     $text .= "</tbody></table>\n</form>";
     $ns->tablerender(GSLAN_24, $mes->render() . $text);
 }
 function SaveDeployment($data, $form)
 {
     $id = convert::raw2sql($data['DeploymentID']);
     // Only loaded if it belongs to current user
     $Deployment = $form->controller->LoadDeployment($id);
     // If a deployment wasn't returned, we'll create a new one
     if (!$Deployment) {
         $Deployment = new Deployment();
         $Deployment->OrgID = Member::currentUser()->getCurrentOrganization()->ID;
         $newDeploy = true;
     }
     $form->saveInto($Deployment);
     $survey = $form->controller->GetCurrentSurvey();
     $Deployment->DeploymentSurveyID = $survey->ID;
     $Deployment->UpdateDate = SS_Datetime::now()->Rfc2822();
     $Deployment->OrgID = $survey->OrgID;
     $Deployment->write();
     /**/
     $survey->CurrentStep = 'MoreDeploymentDetails';
     $survey->HighestStepAllowed = 'MoreDeploymentDetails';
     $survey->UpdateDate = SS_Datetime::now()->Rfc2822();
     $survey->write();
     // If it is a new deployment and it is public, we send an email...
     if (isset($newDeploy) && $Deployment->IsPublic === 1) {
         global $email_new_deployment;
         global $email_from;
         $email = EmailFactory::getInstance()->buildEmail($email_from, $email_new_deployment, 'New Deployment');
         $email->setTemplate('NewDeploymentEmail');
         $email->populateTemplate(array('Deployment' => $Deployment));
         $email->send();
     }
     Session::set('CurrentDeploymentID', $Deployment->ID);
     Controller::curr()->redirect($form->controller->Link() . 'MoreDeploymentDetails');
 }
Esempio n. 3
0
function email_item($thread_id)
{
    global $tp;
    $gen = new convert();
    include_once e_PLUGIN . 'forum/forum_class.php';
    $forum = new e107forum();
    $thread_info = $forum->thread_get($thread_id, 0, 999);
    $thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
    $text = "<b>" . $thread_name . "</b><br />\n\t" . $thread_info[0]['user_name'] . ", " . $gen->convert_date($thread_info[0]['thread_datestamp'], "forum") . "<br /><br />\n\t" . $tp->toHTML($thread_info[0]['thread_thread'], TRUE);
    $count = 1;
    unset($thread_info[0], $thread_info['head']);
    foreach ($thread_info as $reply) {
        $text .= "<br /><br />Re: <b>" . $thread_name . "</b><br />\n\t\t" . $reply['user_name'] . ", " . $gen->convert_date($reply['thread_datestamp'], "forum") . "<br /><br />\n\t\t" . $tp->toHTML($reply['thread_thread'], TRUE);
    }
    return $text;
}
Esempio n. 4
0
 public function INSERT($username, $password)
 {
     if (mssql_num_rows(mssql_query("SELECT * FROM [user] WHERE username='******'")) == 0) {
         $insertQuery = "INSERT INTO\r\n\t\t\t\t[dbo].[user]\r\n\t\t\t\t(\r\n\t\t\t\t\tusername,\r\n\t\t\t\t\tpassword,\r\n\t\t\t\t\tinsert_userID,\r\n\t\t\t\t\tinsert_datetime\r\n\t\t\t\t)VALUES(\r\n\t\t\t\t\t'" . convert::fromUTF($name) . "',\r\n\t\t\t\t\t'{$password}',\r\n\t\t\t\t\t'" . $_COOKIE['id'] . "',\r\n\t\t\t\t\t'" . date('Y-d-m H:i:s', time()) . "'\r\n\t\t\t\t)";
         mssql_query($insertQuery);
     } else {
         echo "username is taken";
     }
 }
Esempio n. 5
0
function get_history($page)
{
    global $sql;
    $r = "<script>\n\tfunction urldecode( str ) {\n\t    var ret = str;\n\t    ret = ret.replace(/\\+/g, '%20');\n\t    ret = decodeURIComponent(ret);\n\t    ret = ret.toString();\n\t    return ret;\n\t}\n\t</script><ul>";
    $sql->db_Select("wiki", "*", "ORDER BY page_datestamp DESC", false);
    $gen = new convert();
    while ($row = $sql->db_Fetch()) {
        $r .= "<li><a href='#' onclick=\"document.getElementById('wiki_content').value=urldecode('" . urlencode(stripslashes($row['page_content'])) . "');\" >" . $gen->convert_date($row['page_datestamp']) . " by " . get_username($row['page_author']) . "</a></li>";
    }
    return $r . "</ul>";
}
 public function member()
 {
     $EmailAddress = "";
     $Member = "";
     // Make sure the access is POST, not GET
     if (!$this->request->isPOST()) {
         return $this->httpError(403, 'Access Denied.');
     }
     if (!defined('APPSEC')) {
         return $this->httpError(403, 'Access Denied.');
     }
     // Make sure the APPSEC shared secret matches
     if ($this->request->postVar('APPSEC') != APPSEC) {
         return $this->httpError(403, 'Access Denied.');
     }
     // Pull email address from POST variables
     $EmailAddress = $this->request->postVar('email');
     // Sanitize the input
     $EmailAddress = convert::raw2sql($EmailAddress);
     // If an email address was provided, try to find a member with it
     if ($EmailAddress) {
         $Member = Member::get()->filter('Email', $EmailAddress)->first();
     }
     $response = new SS_HTTPResponse();
     // If a member was found return status 200 and 'OK'
     if ($Member && $Member->isFoundationMember()) {
         $response->setStatusCode(200);
         $response->setBody('OK');
         $response->output();
     } elseif ($EmailAddress) {
         $response->setStatusCode(404);
         $response->setBody('No Member Found.');
         $response->output();
     } else {
         $response->setStatusCode(500);
         $response->setBody('An error has occurred retrieving a member.');
         $response->output();
     }
 }
 /**
  * @param Controller $controller
  * @param String $name
  * @param Order $order
  * @param String
  */
 function __construct(Controller $controller, $name, Order $order, $returnToLink = '')
 {
     $fields = new FieldList(new HiddenField('OrderID', '', $order->ID));
     if ($returnToLink) {
         $fields->push(new HiddenField("returntolink", "", convert::raw2att($returnToLink)));
     }
     $bottomFields = new CompositeField();
     $bottomFields->addExtraClass('bottomOrder');
     if ($order->Total() > 0) {
         $paymentFields = EcommercePayment::combined_form_fields($order->getTotalAsMoney()->NiceLongSymbol(false), $order);
         foreach ($paymentFields as $paymentField) {
             $bottomFields->push($paymentField);
         }
         if ($paymentRequiredFields = EcommercePayment::combined_form_requirements($order)) {
             $requiredFields = array_merge($requiredFields, $paymentRequiredFields);
         }
     } else {
         $bottomFields->push(new HiddenField("PaymentMethod", "", ""));
     }
     $fields->push($bottomFields);
     $actions = new FieldList(new FormAction('dopayment', _t('OrderForm.PAYORDER', 'Pay balance')));
     $requiredFields = array();
     $validator = OrderForm_Payment_Validator::create($requiredFields);
     $form = parent::__construct($controller, $name, $fields, $actions, $validator);
     //extension point
     $this->extend('updateFields', $fields);
     $this->setFields($fields);
     $this->extend('updateActions', $actions);
     $this->setActions($actions);
     $this->extend('updateValidator', $validator);
     $this->setValidator($validator);
     $this->setFormAction($controller->Link($name));
     $oldData = Session::get("FormInfo.{$this->FormName()}.data");
     if ($oldData && (is_array($oldData) || is_object($oldData))) {
         $this->loadDataFrom($oldData);
     }
     $this->extend('updateOrderForm_Payment', $this);
 }
Esempio n. 8
0
 static function znajdz($KOD, $ISBN, $dir = 'covers')
 {
     if (strlen($KOD) <= 8 && ctype_digit($KOD)) {
         validate::KOD($KOD);
         if (file_exists('./' . $dir . '/own/' . $KOD)) {
             return './' . $dir . '/own/' . $KOD;
         }
     }
     if (strlen($ISBN) == 13) {
         validate::EAN($ISBN);
         if (substr($ISBN, 0, 3) == '978') {
             $ISBN10 = convert::ISBN13_to_ISBN10($ISBN);
         } else {
             $ISBN10 = $ISBN;
         }
         if (file_exists('./' . $dir . '/own/' . $ISBN)) {
             return './' . $dir . '/own/' . $ISBN;
         }
         if (self::librarything($ISBN, $dir) !== FALSE) {
             return './' . $dir . '/' . $ISBN;
         }
     }
     return FALSE;
 }
Esempio n. 9
0
 public static function simpleXmlToArray($xml, &$recursion_depth = 0)
 {
     if ($recursion_depth > 25) {
         // Fatal error. Exit now.
         return null;
     }
     if ($recursion_depth == 0) {
         if (get_class($xml) != 'SimpleXMLElement') {
             // If the external caller doesn't call this function initially
             // with a SimpleXMLElement object, return now.
             return null;
         } else {
             // Store the original SimpleXmlElementObject sent by the caller.
             // We will need it at the very end when we return from here for good.
             $provided_xml = $xml;
         }
     }
     if (get_class($xml) == 'SimpleXMLElement') {
         // Get a copy of the simpleXmlElementObject
         $copy_xml = $xml;
         // Get the object variables in the SimpleXmlElement object for us to iterate.
         $xml = get_object_vars($xml);
     }
     // It needs to be an array of object variables.
     if (is_array($xml)) {
         // Initialize the result array.
         $result_array = array();
         // Is the input array size 0? Then, we reached the rare CDATA text if any.
         if (count($xml) <= 0) {
             // Let us return the lonely CDATA. It could even be
             // an empty element or just filled with whitespaces.
             return trim(strval($copy_xml));
         }
         // Let us walk through the child elements now.
         foreach ($xml as $key => $value) {
             // When this block of code is commented, XML attributes will be
             // added to the result array.
             // Uncomment the following block of code if XML attributes are
             // NOT required to be returned as part of the result array.
             /*
             if((is_string($key)) && ($key == SIMPLE_XML_ELEMENT_OBJECT_PROPERTY_FOR_ATTRIBUTES)) {
               continue;
             }
             */
             // Let us recursively process the current element we just visited.
             // Increase the recursion depth by one.
             $recursion_depth++;
             $result_array[$key] = convert::simpleXmlToArray($value, $recursion_depth);
             // Decrease the recursion depth by one.
             $recursion_depth--;
         }
         if ($recursion_depth == 0) {
             // That is it. We are heading to the exit now.
             // Set the XML root element name as the root [top-level] key of
             // the associative array that we are going to return to the caller of this
             // recursive function.
             $temp_array = $result_array;
             $result_array = array();
             $result_array[$provided_xml->getName()] = $temp_array;
         }
         return $result_array;
     } else {
         // We are now looking at either the XML attribute text or
         // the text between the XML tags.
         return trim(strval($xml));
     }
     // End of else
 }
Esempio n. 10
0
 function __construct($controller, $name, $order, $returnToLink = '')
 {
     $fields = new FieldSet(new HiddenField('OrderID', '', $order->ID));
     if ($returnToLink) {
         $fields->push(new HiddenField("returntolink", "", convert::raw2att($returnToLink)));
     }
     $totalAsCurrencyObject = $order->TotalAsCurrencyObject();
     $totalOutstandingAsMoneyObject = $order->TotalOutstandingAsMoneyObject();
     $paymentFields = Payment::combined_form_fields($totalOutstandingAsMoneyObject->Nice());
     foreach ($paymentFields as $paymentField) {
         if ($paymentField->class == "HeaderField") {
             $paymentField->setTitle(_t("OrderForm.MAKEPAYMENT", "Make Payment"));
         }
         $fields->push($paymentField);
     }
     $requiredFields = array();
     if ($paymentRequiredFields = Payment::combined_form_requirements()) {
         $requiredFields = array_merge($requiredFields, $paymentRequiredFields);
     }
     $actions = new FieldSet(new FormAction('dopayment', _t('OrderForm.PAYORDER', 'Pay balance')));
     $form = parent::__construct($controller, $name, $fields, $actions, $requiredFields);
     if ($this->extend('updateFields', $fields) !== null) {
         $this->setFields($fields);
     }
     if ($this->extend('updateActions', $actions) !== null) {
         $this->setActions($actions);
     }
     if ($this->extend('updateValidator', $validator) !== null) {
         $this->setValidator($validator);
     }
     $this->setFormAction($controller->Link($name));
     $this->extend('updateOrderFormPayment', $this);
 }
 public function UPDATE($id, $name, $login, $password, $owner)
 {
     $updateQuery = "UPDATE \r\n\t\t\t\t[dbo].[registrator]\r\n\t\t\tSET \r\n\t\t\t\tname = '" . convert::fromUTF($name) . "',\r\n\t\t\t\tupdate_userID \t= '" . $_COOKIE['id'] . "',\r\n\t\t\t\tupdate_datetime = '" . date('m-d-Y H:i:s', time()) . "',\r\n\t\t\t\tlogin = '******',\r\n\t\t\t\tpassword = '******',\r\n\t\t\t\towner = '{$owner}'\r\n\t\t\tWHERE \r\n\t\t\t\tid={$id}\r\n\t\t\t;";
     mssql_query($updateQuery);
 }
Esempio n. 12
0
 function getListData()
 {
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if ($this->parent->mode == 'new_page' || $this->parent->mode == 'new_menu') {
         // New posts since last visit, up to limit
         $lvisit = $this->parent->getlvisit();
         $qry = "\n\t\t\tSELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, \n\t\t\tf.forum_id, f.forum_name, f.forum_class, \n\t\t\tu.user_name, lp.user_name AS lp_name, \n\t\t\tt.thread_id, t.thread_views as tviews, t.thread_name, t.thread_datestamp, t.thread_user,\n\t\t\ttp.post_thread, tp.post_user, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies\n\t\t\tFROM #forum_thread AS t\n\t\t\tLEFT JOIN #forum_post AS tp ON t.thread_id = tp.post_thread\n\t\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\t\tLEFT JOIN #user AS u ON tp.post_user = u.user_id\n\t\t\tLEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id\n\t\t\tWHERE find_in_set(forum_class, '" . USERCLASS_LIST . "')\n\t\t\tAND t.thread_lastpost > {$lvisit}\n\t\t\tORDER BY tp.post_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
     } else {
         // Most recently updated threads up to limit
         $qry = "\n\t\t\tSELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, \n\t\t\tt.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name\n\t\t\tFROM #forum_thread AS t\n\t\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\t\tLEFT JOIN #user AS u ON t.thread_user = u.user_id\n\t\t\tLEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id\n\t\t\tWHERE find_in_set(f.forum_class, '" . USERCLASS_LIST . "')\n\t\t\tORDER BY t.thread_lastpost DESC LIMIT 0," . intval($this->parent->settings['amount']);
     }
     if (!($results = $this->parent->e107->sql->gen($qry))) {
         $list_data = LIST_FORUM_2;
     } else {
         $forumArray = $this->parent->e107->sql->db_getList();
         $path = e_PLUGIN . "forum/";
         foreach ($forumArray as $forumInfo) {
             extract($forumInfo);
             $record = array();
             //last user
             $r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
             $r_name = substr($thread_lastuser, strpos($thread_lastuser, ".") + 1);
             if (strstr($thread_lastuser, chr(1))) {
                 $tmp = explode(chr(1), $thread_lastuser);
                 $r_name = $tmp[0];
             }
             $thread_lastuser = $r_id;
             //user
             $u_id = substr($thread_user, 0, strpos($thread_user, "."));
             $u_name = substr($thread_user, strpos($thread_user, ".") + 1);
             $thread_user = $u_id;
             if (isset($thread_anon)) {
                 $tmp = explode(chr(1), $thread_anon);
                 $thread_user = $tmp[0];
                 $thread_user_ip = $tmp[1];
             }
             $gen = new convert();
             $r_datestamp = $gen->convert_date($thread_lastpost, "short");
             if ($thread_total_replies) {
                 $LASTPOST = "";
                 if ($lp_name) {
                     $LASTPOST = "<a href='" . e_HTTP . "user.php ?id.{$thread_lastuser}'>{$lp_name}</a>";
                 } else {
                     if ($thread_lastuser[0] == "0") {
                         $LASTPOST = substr($thread_lastuser, 2);
                     } else {
                         //$LASTPOST = NFPM_L16;
                     }
                 }
                 $LASTPOST .= " " . LIST_FORUM_6 . " <span class='smalltext'>{$r_datestamp}</span>";
             } else {
                 $LASTPOST = " - ";
                 $LASTPOSTDATE = '';
             }
             if ($parent_name == '') {
                 $parent_name = $thread_name;
             }
             $rowheading = $this->parent->parse_heading($parent_name);
             $lnk = $parent_id ? $thread_id . ".post" : $thread_id;
             $record['heading'] = "<a href='" . $path . "forum_viewtopic.php?{$lnk}'>" . $rowheading . "</a>";
             $record['author'] = $this->parent->settings['author'] ? $thread_anon ? $thread_user : "******" . e_HTTP . "user.php ?id.{$thread_user}'>{$user_name}</a>" : "";
             $record['category'] = $this->parent->settings['category'] ? "<a href='" . $path . "forum_viewforum.php?{$forum_id}'>{$forum_name}</a>" : "";
             $record['date'] = $this->parent->settings['date'] ? $this->parent->getListDate($thread_datestamp) : "";
             $record['icon'] = $bullet;
             $VIEWS = $thread_views;
             $REPLIES = $thread_total_replies;
             if ($thread_total_replies) {
                 $record['info'] = "[ " . LIST_FORUM_3 . " " . $VIEWS . ", " . LIST_FORUM_4 . " " . $REPLIES . ", " . LIST_FORUM_5 . " " . $LASTPOST . " ]";
             } else {
                 $record['info'] = "[ " . LIST_FORUM_3 . " " . intval($tviews) . " ]";
             }
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
Esempio n. 13
0
    switch ($_GET['f']) {
        case 'mfar':
            $forum->forumMarkAsRead($id);
            header('location:' . e_SELF);
            exit;
            break;
        case 'rules':
            include_once HEADERF;
            forum_rules('show');
            include_once FOOTERF;
            exit;
            break;
    }
}
$fVars = new e_vars();
$gen = new convert();
$fVars->FORUMTITLE = LAN_PLUGIN_FORUM_NAME;
$fVars->THREADTITLE = LAN_FORUM_0002;
$fVars->REPLYTITLE = LAN_FORUM_0003;
$fVars->LASTPOSTITLE = LAN_FORUM_0004;
$fVars->INFOTITLE = LAN_FORUM_0009;
$fVars->LOGO = IMAGE_e;
$fVars->NEWTHREADTITLE = LAN_FORUM_0075;
$fVars->POSTEDTITLE = LAN_FORUM_0074;
$fVars->NEWIMAGE = IMAGE_new_small;
$fVars->TRACKTITLE = LAN_FORUM_0073;
$rules_text = forum_rules('check');
$fVars->USERINFO = "<a href='" . e_BASE . "top.php?0.top.forum.10'>" . LAN_FORUM_0010 . "</a> | <a href='" . e_BASE . "top.php?0.active'>" . LAN_FORUM_0011 . "</a>";
if (USER) {
    $fVars->USERINFO .= " | <a href='" . e_BASE . 'userposts.php?0.forums.' . USERID . "'>" . LAN_FORUM_0012 . "</a> | <a href='" . e_BASE . "usersettings.php'>" . LAN_FORUM_0013 . "</a> | <a href='" . e_HTTP . "user.php ?id." . USERID . "'>" . LAN_FORUM_0014 . "</a>";
    if ($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) {
Esempio n. 14
0
    $texta .= "</div>\n</form>\n";
}
if ($emessage != "") {
    $texta .= "<div style='text-align:center'><b>" . $emessage . "</b></div>";
}
if (!($text = $e107cache->retrieve("nq_chatbox"))) {
    global $pref, $tp;
    $pref['chatbox_posts'] = $pref['chatbox_posts'] ? $pref['chatbox_posts'] : 10;
    $chatbox_posts = $pref['chatbox_posts'];
    if (!isset($pref['cb_mod'])) {
        $pref['cb_mod'] = e_UC_ADMIN;
    }
    define("CB_MOD", check_class($pref['cb_mod']));
    $qry = "\n\tSELECT c.*, u.user_name FROM #chatbox AS c\n\tLEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id\n\tORDER BY c.cb_datestamp DESC LIMIT 0, " . intval($chatbox_posts);
    if ($sql->db_Select_gen($qry)) {
        $obj2 = new convert();
        $cbpost = $sql->db_getList();
        $text .= "<div id='chatbox-posts-block'>\n";
        foreach ($cbpost as $cb) {
            // get available vars
            list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2);
            if ($cb['user_name']) {
                $cb_nick = "<a href='" . e_HTTP . "user.php?id.{$cb_uid}'>{$cb['user_name']}</a>";
            } else {
                $cb_nick = $tp->toHTML($cb_nick, FALSE, 'USER_TITLE, emotes_off, no_make_clickable');
                $cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
            }
            $datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
            $emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
            $cb_message = $tp->toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
            $replace[0] = "[";
 public function markForeignAccount()
 {
     try {
         $foreign_id = intval(convert::raw2sql($this->request->param('FOREIGN_MEMBER_ID')));
         $current_member = Member::currentUser();
         $this->manager->markAsNotMyAccount($current_member->ID, $foreign_id);
         return $this->ok();
     } catch (NotFoundEntityException $ex1) {
         SS_Log::log($ex1, SS_Log::WARN);
         return $this->notFound($ex1->getMessage());
     } catch (EntityValidationException $ex2) {
         SS_Log::log($ex2, SS_Log::WARN);
         return $this->validationError($ex2->getMessages());
     } catch (Exception $ex) {
         SS_Log::log($ex, SS_Log::ERR);
         return $this->serverError();
     }
 }
Esempio n. 16
0
 public function __construct($id, $name)
 {
     $this->id = $id;
     $this->name = convert::toUTF($name);
 }
Esempio n. 17
0
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_plugins/poll/oldpolls.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
require_once "../../class2.php";
if (!e107::isInstalled('poll')) {
    header("Location: " . e_BASE . "index.php");
    exit;
}
require_once HEADERF;
require_once e_HANDLER . "comment_class.php";
$cobj = new comment();
$gen = new convert();
if (!defined("USER_WIDTH")) {
    define("USER_WIDTH", "width:95%");
}
include_lan(e_PLUGIN . "poll/languages/" . e_LANGUAGE . ".php");
if (e_QUERY) {
    $query = "SELECT p.*, u.user_id, u.user_name FROM #polls AS p\n\tLEFT JOIN #user AS u ON p.poll_admin_id = u.user_id\n\tWHERE p.poll_type=1 AND p.poll_id=" . intval(e_QUERY);
    if ($sql->db_Select_gen($query)) {
        $row = $sql->db_Fetch();
        extract($row);
        $optionArray = explode(chr(1), $poll_options);
        $optionArray = array_slice($optionArray, 0, -1);
        $voteArray = explode(chr(1), $poll_votes);
        $voteArray = array_slice($voteArray, 0, -1);
        $voteTotal = array_sum($voteArray);
        $percentage = array();
Esempio n. 18
0
function print_item_pdf($id)
{
    global $tp, $pref, $content_shortcodes;
    global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent;
    //in this section you decide what to needs to be output to the pdf file
    $con = new convert();
    require_once e_PLUGIN . "content/content_shortcodes.php";
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    if (!is_object($sql)) {
        $sql = new db();
    }
    $sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' ");
    $row = $sql->db_Fetch();
    if (!check_class($row['content_class'])) {
        header("location:" . e_PLUGIN . "content/content.php");
        exit;
    }
    $authordetails = $aa->getAuthor($row['content_author']);
    $row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long");
    $img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
    $mainparent = $aa->getMainParent(intval($id));
    $content_pref = $aa->getContentPref($mainparent);
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $content_image_path = $tp->replaceConstants($content_pref["content_image_path"]);
    $img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
    //add custom and preset tags if present
    $custom = e107::unserialize($row['content_pref']);
    //$custom						= $eArrayStorage->ReadxxxArray($row['content_pref']);
    $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
    $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
    if (!empty($custom)) {
        foreach ($custom as $k => $v) {
            if ($k == "content_custom_presettags") {
                if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) {
                    foreach ($v as $ck => $cv) {
                        if (is_array($cv)) {
                            //date
                            if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) {
                                $vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year'];
                            }
                        } else {
                            $vv = $cv;
                        }
                        if (isset($ck) && $ck != "" && isset($vv) && $vv != "") {
                            $CUSTOM_TAGS = TRUE;
                            $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                        }
                    }
                }
            } else {
                if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) {
                    $key = substr($k, 15);
                    if (isset($key) && $key != "" && isset($v) && $v != "") {
                        $CUSTOM_TAGS = TRUE;
                        $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                    }
                }
            }
        }
    }
    $text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t";
    //the following defines are processed in the document properties of the pdf file
    //Do NOT add parser function to the variables, leave them as raw data !
    //as the pdf methods will handle this !
    $text = $text;
    //define text
    $creator = SITENAME;
    //define creator
    $author = $authordetails[1];
    //define author
    $title = $row['content_heading'];
    //define title
    $subject = $row['content_subheading'];
    //define subject
    $keywords = "";
    //define keywords
    //define url to use in the header of the pdf file
    $url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id'];
    //always return an array with the following data:
    return array($text, $creator, $author, $title, $subject, $keywords, $url);
}
Esempio n. 19
0
         while ($row = $e107->sql->db_Fetch()) {
             $ga = new convert();
             $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], 'long');
             $text .= "<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . $row['newsletter_issue'] . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href='" . e_PLUGIN . "newsletter/nl_archive.php?show." . $action_parent_id . "." . $row['newsletter_id'] . "'>" . $tp->toHTML($row['newsletter_title'], true) . "</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . $newsletter_datestamp . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t  </tr>";
         }
         $text .= "</table>";
         if ($limit_start + $page_size < $nl_count) {
             $text .= "<form id='nl' method='post' action='" . e_PLUGIN . "newsletter/nl_archive.php?showp." . $action_parent_id . "'>\n\t\t\t\t<br /><input class='button' name='submit' type='submit' value='View older newsletters in archive'/>\n\t\t\t\t<input type='hidden' name='limit_start' value='" . $limit_start . "'/></form>";
         }
     } else {
         $e107->sql->db_Select('newsletter', '*', "newsletter_parent='" . $action_parent_id . "' AND newsletter_id='" . $action_nl_id . "' AND newsletter_flag='1'");
         if ($row = $e107->sql->db_Fetch()) {
             // Display parent header
             $text .= "{$parent_newsletter_title}<br />\n\t\t\t\t\t\t  <div style='text-align: left;'>{$parent_newsletter_text}</div><br /><br />\n\t\t\t\t\t\t  {$parent_newsletter_header}<br /><br />";
             // Display newsletter text
             $ga = new convert();
             $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], "long");
             $text .= $newsletter_datestamp . "<br />" . $tp->toHTML($row['newsletter_title'], true) . "<br />\n\t\t\t\t\t\t <div style='text-align: left;'>" . $tp->toHTML($row['newsletter_text'], true) . "</div><br /><br />";
             // Display parent footer
             $text .= "{$parent_newsletter_footer}<br />";
             // Display back to newsletter overview button
             $text .= "<br /><a href='javascript:history.go(-1);'><input class='button' type='submit' value='" . NLLAN_71 . "'</a>";
         } else {
             $text .= NLLAN_70;
             //Selected newsletter does not exist
         }
     }
 } else {
     $text .= NLLAN_69;
     // No send newsletters available for selected parent
 }
Esempio n. 20
0
     $evrsn_nownotbeta = false;
     // Check if now not beta
     if ($evrsn_tmpupdate[2] == 0 && $evrsn_tmpcurrent[2] > 0) {
         $evrsn_nownotbeta = true;
     }
     if ($evrsn_update > $evrsn_current || $evrsn_nownotbeta) {
         // if server version greater than installed version
         $evrsn_text .= "<tr><td class='eb_td'><img src='" . e_IMAGE . "admin_images/uninstalled.png' alt='' title='' /> " . EVERSION_U7 . " - <strong>" . $evrsn_serversion . "</strong>";
         if ($evrsn_tmpupdate[2] > 0) {
             // is it a beta version?
             $evrsn_text .= "<br />" . EVERSION_U8;
         } else {
             $evrsn_text .= "<strong> " . EVERSION_U21 . "</strong>";
         }
         if ($evrsn_date > 0) {
             $evrsn_con = new convert();
             $evrsn_text .= "<br />" . EVERSION_U17 . " : <strong>" . $evrsn_con->convert_date($evrsn_date, "long") . "</strong><br />";
         }
         if (!empty($evrsn_author)) {
             $evrsn_text .= "<br />" . EVERSION_U18 . " : <strong>" . $evrsn_author . "</strong><br />";
         }
         if (!empty($evrsn_url)) {
             $evrsn_text .= "<br /><br />" . EVERSION_U13 . " <a href='" . $evrsn_url . "'>" . EVERSION_U14 . "</a><br />&nbsp;";
         }
         $evrsn_text .= "</td></tr>";
     } else {
         // It is the latest version
         $evrsn_text .= "<tr><td class='eb_td'><img src='" . e_IMAGE . "admin_images/installed.png' alt='' title='' /> " . EVERSION_U9;
         $evrsn_text .= "<br /><br />" . EVERSION_U13 . " <a href='" . $evrsn_url . "'>" . EVERSION_U14 . "</a><br /></td></tr>";
     }
 } else {
Esempio n. 21
0
    if (!empty($jobNumFrm) && empty($jobNumTom)) {
        $condition = $condition . $andRule . " jobOrder_jobNum>=" . $jobNumFrm;
    } else {
        if (empty($jobNumFrm) && !empty($jobNumTom)) {
            $condition = $condition . $andRule . " jobOrder_jobNum<=" . $jobNumTom;
        } else {
            $condition = $condition;
        }
    }
}
$xcelCondition = $condition . " ORDER BY jobOrder_jobNum ASC";
// excel file name
$filesname = "list_of_job_orders.xls";
// excel workbook sheet name
$sheetname = "list_of_job_orders";
$excel = convert::toexcel($filesname, $sheetname);
// for header
$infoHeader = array($header);
$excel->writeLine($infoHeader);
$whiteSpace = array("");
$excel->writeLine($whiteSpace);
$jo_dselect = "\r\n\t\t\t\t\t\t\tjoborder.jobOrder_id,\r\n\t\t\t\t\t\t\tjoborder.jobOrder_Branch,\r\n\t\t\t\t\t\t\tjoborder.jobOrder_clientNum,\r\n\t\t\t\t\t\t\tjoborder.jobOrder_jobNum";
$list = $pdo_sql->fetchAll($dbtable = "joborder", $jo_dselect, $xcelCondition);
$countList = $pdo_sql->count($dbtable = "joborder", $jo_dselect, $xcelCondition);
if (count($list) >= 1) {
    $joListNum = '';
    foreach ($list as $listKey => $listVal) {
        // get the necessary data from the database
        $jobOrderId = $listVal['jobOrder_id'];
        $listBranch = $listVal['jobOrder_Branch'];
        $listCnumber = $listVal['jobOrder_clientNum'];
Esempio n. 22
0
 /**
  *	Display list of recent visitors to site - essentially up to (currently 20) of the entries from today's stats
  *
  *	@return string - text for display
  */
 function recentVisitors()
 {
     if (!is_array($this->fileRecent) || !count($this->fileRecent)) {
         return "<div style='text-align: center;'>" . ADSTAT_L25 . ".</div>";
     }
     $gen = new convert();
     $recentArray = array_reverse($this->fileRecent, TRUE);
     $text = "\n\t\t\t<table class='table table-striped fborder' style='width: 100%;'>\n\t\t\t<tr>\n\t\t\t\t<th class='fcaption' style='width: 30%;'>" . ADSTAT_L18 . "</th>\n\t\t\t\t<th class='fcaption' style='width: 70%;'>Information</th>\n\t\t\t</tr>\n";
     foreach ($recentArray as $key => $info) {
         if (is_array($info)) {
             $host = $info['host'];
             $datestamp = $info['date'];
             $os = $info['os'];
             $browser = $info['browser'];
             $screen = $info['screen'];
             $referer = $info['referer'];
         } else {
             list($host, $datestamp, $os, $browser, $screen, $referer) = explode(chr(1), $info);
         }
         $datestamp = $gen->convert_date($datestamp, "long");
         $text .= "<tr>\n\t\t\t<td class='forumheader3' style='width: 30%;'>{$datestamp}</td>\n\t\t\t<td class='forumheader3' style='width: 70%;'>Host: {$host}<br />" . ADSTAT_L26 . ": {$browser}<br />" . ADSTAT_L27 . ": {$os}<br />" . ADSTAT_L29 . ": {$screen}" . ($referer ? "<br />" . ADSTAT_L32 . ": <a href='{$referer}' rel='external'>{$referer}</a>" : "") . "</td>\n\t\t\t</tr>\n";
     }
     $text .= "</table>";
     return $text;
 }
Esempio n. 23
0
    } else {
        $text .= "&nbsp;";
    }
    $text .= "</td>\r\n\t\t</tr>\r\n\t\t";
    $c++;
}
$c = 0;
while ($files[$c]) {
    $img = substr(strrchr($files[$c], "."), 1, 3);
    if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) {
        $img = "def";
    }
    //$size = parsesize(filesize(e_BASE.$path."/".$files[$c]));
    $size = parsesize(filesize($path . "/" . $files[$c]));
    $text .= "<tr>\r\n\t\t<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">\r\n\t\t<img src=\"" . $imagedir . $img . ".png\" alt=\"" . $files[$c] . "\" style=\"border:0\" />\r\n\t\t</td>\r\n\t\t<td style=\"width:30%\" class=\"forumheader3\">\r\n\t\t<!-- <a href=\"" . e_SELF . "?" . $path . $files[$c] . "\">" . $files[$c] . "</a> -->\r\n\t\t" . $files[$c] . "\r\n\t\t</td>";
    $gen = new convert();
    //$filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
    $filedate = $gen->convert_date(filemtime($path . "/" . $files[$c]), "forum");
    $text .= "<td style=\"width:10%\" class=\"forumheader3\">" . $size . "</td>\r\n\t\t<td style=\"width:30%\" class=\"forumheader3\">" . $filedate . "</td>\r\n\t\t<td class=\"forumheader3\">";
    // EasyShop modification: suppress the delete option for index.html and .htaccess and for files without extension
    $extension = strrpos($files[$c], ".") ? substr($files[$c], strrpos($files[$c], ".")) : "";
    if ($files[$c] != "index.html" && $files[$c] != ".htaccess" && strlen($extension) != 0) {
        $text .= "<input  type=\"checkbox\" name=\"selectedfile[{$c}]\" value=\"1\" />";
    } else {
        if (strlen($extension) == 0 and strlen($files[$c]) == 32) {
            // Files with length 32 and without extension are assumed to be the MD5 protected files
            $text .= EASYSHOP_UPLOAD_51;
            // Message to inform that downloadable file is linked to product
        }
    }
    $text .= "<input type=\"hidden\" name=\"deleteconfirm[{$c}]\" value=\"" . $path . $files[$c] . "\" />";
Esempio n. 24
0
File: pdf.php Progetto: notzen/e107
    $plugin = substr($source, 7);
    if (file_exists(e_PLUGIN . $plugin . '/e_emailprint.php')) {
        include_once e_PLUGIN . $plugin . '/e_emailprint.php';
        if (function_exists('print_item_pdf')) {
            $text = print_item_pdf($parms);
            $pdf->makePDF($text);
        } else {
            echo 'PDF generation not supported in this section';
        }
    } else {
        echo 'file missing: ' . e_PLUGIN . $plugin . '/e_emailprint.php';
        exit;
    }
} else {
    if ($source == 'news') {
        $con = new convert();
        $sql->db_Select('news', '*', 'news_id=' . intval($parms));
        $row = $sql->db_Fetch();
        $news_body = $tp->toHTML($row['news_body'], TRUE);
        $news_extended = $tp->toHTML($row['news_extended'], TRUE);
        if ($row['news_author'] == 0) {
            $a_name = 'e107';
            $category_name = 'e107 welcome message';
        } else {
            $sql->db_Select('news_category', 'category_id, category_name', 'category_id=' . intval($row['news_category']));
            list($category_id, $category_name) = $sql->db_Fetch();
            $sql->db_Select('user', 'user_id, user_name', 'user_id=' . intval($row['news_author']));
            list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
        }
        $row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long");
        $row['news_title'] = $tp->toHTML($row['news_title'], TRUE, 'parse_sc');
Esempio n. 25
0
            $online_location = e_PLUGIN . "forum/forum_viewtopic.php?{$tmp['0']}.{$tmp['1']}";
        }
    }
    if (strstr($online_location, "admin")) {
        $class_check = FALSE;
        $online_location_page = ADMINAREA;
    }
    $ONLINE_TABLE_ICON = varsettrue($pref['plug_installed']['pm']) && $oid != USERID ? $tp->parseTemplate("{SENDPM={$oid}}", 'sendpm.sc') : "<img src='" . e_PLUGIN . "online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />";
    $ONLINE_TABLE_USERNAME = "******" . e_BASE . "user.php?id.{$oid}'>{$oname}</a>";
    $ONLINE_TABLE_LOCATION = $class_check ? "<a href='{$online_location}'>{$online_location_page}</a>" : $online_location_page;
    $textstring .= preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE);
}
$ONLINE_TABLE_MEMBERS_ONLINE = ONLINE_EL1 . GUESTS_ONLINE;
$ONLINE_TABLE_GUESTS_ONLINE = ONLINE_EL2 . MEMBERS_ONLINE;
if (!isset($gen) || !is_object($gen)) {
    $gen = new convert();
}
$siteHistory = e107::getConfig('history')->getPref('');
$datestamp = $gen->convert_date($siteHistory['most_online_datestamp'], "short");
$ONLINE_TABLE_MOST_EVER_ONLINE = ONLINE_EL8 . ($siteHistory['most_members_online'] + $siteHistory['most_guests_online']);
$ONLINE_TABLE_MOST_MEMBERS_ONLINE = ONLINE_EL2 . $siteHistory['most_members_online'];
$ONLINE_TABLE_MOST_GUESTS_ONLINE = ONLINE_EL1 . $siteHistory['most_guests_online'];
$ONLINE_TABLE_DATESTAMP = $datestamp;
$total_members = $sql->db_Count("user", "(*)", "where user_ban = 0");
if ($total_members > 1) {
    $newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban=0 ORDER BY user_join DESC LIMIT 0,1");
    $row = $sql->db_Fetch();
    $ONLINE_TABLE_MEMBERS_TOTAL = "<br />" . ONLINE_EL5 . ": " . $total_members;
    $ONLINE_TABLE_MEMBERS_NEWEST = "<br />" . ONLINE_EL6 . ": " . (USER ? "<a href='" . e_BASE . "user.php?id." . $row['user_id'] . "'>" . $row['user_name'] . "</a>" : $row['user_name']);
}
$text = '';
Esempio n. 26
0
 public function UPDATE($id, $name)
 {
     $updateQuery = "UPDATE \r\n\t\t\t\t[dbo].[manager]\r\n\t\t\tSET \r\n\t\t\t\tname \t\t\t= '" . convert::fromUTF($name) . "',\r\n\t\t\t\tupdate_userID \t= '" . $_COOKIE['id'] . "',\r\n\t\t\t\tupdate_datetime = '" . date('m-d-Y H:i:s', time()) . "'\r\n\t\t\tWHERE \r\n\t\t\t\tid={$id}\r\n\t\t\t;";
     mssql_query($updateQuery);
 }
Esempio n. 27
0
function show_newsarchive($newsAr, $i = 1)
{
    global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2;
    // do not show the news archive on the news.php?item.X page (but only on the news mainpage)
    require_once e_CORE . 'shortcodes/batch/news_archives.php';
    $textnewsarchive = '';
    ob_start();
    $i++;
    // First entry to show
    while (isset($newsAr[$i])) {
        $news2 = $newsAr[$i];
        // Code from Lisa
        // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
        // instead of the actual hyperlink that may have been added to a newstitle on creation
        $search = array();
        $replace = array();
        $search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";
        $replace[0] = '\\2';
        $search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
        $replace[1] = '\\2';
        $search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
        $replace[2] = '\\2';
        $search[3] = "/\\<a href=&quot;(.*?)&quot;>(.*?)<\\/a>/si";
        $replace[3] = '\\2';
        $search[4] = "/\\<a href=&#39;(.*?)&#39;>(.*?)<\\/a>/si";
        $replace[4] = '\\2';
        $news2['news_title'] = preg_replace($search, $replace, $news2['news_title']);
        // End of code from Lisa
        $gen = new convert();
        $news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short");
        if (!$NEWSARCHIVE) {
            $NEWSARCHIVE = "<div>\n\t\t\t\t\t<table style='width:98%;'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t<div>{ARCHIVE_BULLET} <b>{ARCHIVE_LINK}</b> <span class='smalltext'><i>{ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})</i></span></div>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</div>";
        }
        $textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes);
        $i++;
    }
    $ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive');
    $newsarchive = ob_get_contents();
    ob_end_flush();
    // dump collected data
    setNewsCache('newsarchive', $newsarchive);
}
Esempio n. 28
0
 function sc_newsinfo()
 {
     $news_item = $this->news_item;
     $param = $this->param;
     $con = new convert();
     $news_item['news_start'] = isset($news_item['news_start']) && $news_item['news_start'] ? str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_start'], 'long')) : LAN_NEWS_19;
     $news_item['news_end'] = isset($news_item['news_end']) && $news_item['news_end'] ? ' to ' . str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_end'], 'long')) : '';
     $info = $news_item['news_render_type'] == 1 ? LAN_NEWS_9 : '';
     $info .= $news_item['news_class'] == 255 ? LAN_NEWS_10 : LAN_NEWS_11;
     $info .= $news_item['news_sticky'] ? '<br />' . LAN_NEWS_31 : '';
     $info .= '<br />' . ($news_item['news_allow_comments'] ? LAN_NEWS_13 : LAN_NEWS_12);
     $info .= LAN_NEWS_14 . $news_item['news_start'] . $news_item['news_end'] . '<br />';
     $info .= LAN_NEWS_15 . strlen($news_item['news_body']) . LAN_NEWS_16 . strlen($news_item['news_extended']) . LAN_NEWS_17 . "<br /><br />";
     //return $ns->tablerender(LAN_NEWS_18, $info);
     return $info;
 }
Esempio n. 29
0
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/message.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
require_once "../class2.php";
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE);
$e_sub_cat = 'message';
require_once "auth.php";
$gen = new convert();
$messageTypes = array("Broken Download", "Dev Team Message");
$queryString = "";
foreach ($messageTypes as $types) {
    $queryString .= " gen_type='{$types}' OR";
}
$queryString = substr($queryString, 0, -3);
if (isset($_POST['delete_message'])) {
    if (preg_match("/\\s[0-9]+/si", $_POST['delete_message'], $match)) {
        $id = $match[0];
        $sql->db_Delete("generic", "gen_id={$id}");
        $message = MESSLAN_3;
    }
}
if (isset($_POST['delete_all']) && isset($_POST['deleteconfirm'])) {
    $sql->db_Delete("generic", $queryString);
    /**
     * Standard SS function
     * if set to false, user can edit order, if set to true, user can only review order
     **/
    public function init()
    {
        parent::init();
        Requirements::themedCSS('CheckoutPage');
        Requirements::javascript('ecommerce/javascript/EcomPayment.js');
        Requirements::customScript('
			if (typeof EcomOrderForm != "undefined") {
				EcomOrderForm.set_TermsAndConditionsMessage(\'' . convert::raw2js($this->TermsAndConditionsMessage) . '\');
			}', "TermsAndConditionsMessage");
        $this->steps = EcommerceConfig::get("CheckoutPage_Controller", "checkout_steps");
        if ($this->HasCheckoutSteps) {
            $this->currentStep = $this->request->Param("ID");
            if ($this->currentStep && in_array($this->currentStep, $this->steps)) {
                //do nothing
            } else {
                $this->currentStep = array_shift($this->steps);
            }
        }
    }