public function update_widget()
 {
     $widget = '';
     $url = litepublisher::$site->url . $this->url . litepublisher::$site->q . 'id';
     foreach ($this->items as $name => $classname) {
         $service = getinstance($classname);
         if ($service->valid()) {
             $widget .= "<a href=\"{$url}={$name}&backurl=\" class=\"{$name}-regservice\" title=\"{$service->title}\"></a>";
         }
     }
     $widget = str_replace('&', '&amp;', $widget);
     $this->widget = $this->widget_title . sprintf('<div class="regservices">%s</div>', $widget);
     $this->save();
     $admin = tadminlogin::i();
     $admin->widget = $this->widget;
     $admin->save();
     $admin = tadminreguser::i();
     $admin->widget = $this->widget;
     $admin->save();
     $tc = ttemplatecomments::i();
     if ($i = strpos($tc->regaccount, $this->widget_title)) {
         $tc->regaccount = trim(substr($tc->regaccount, 0, $i));
     }
     $tc->regaccount .= "\n" . $this->widget;
     $tc->save();
 }
function uloginUninstall($self)
{
    tusers::i()->unbind('tregserviceuser');
    turlmap::unsub($self);
    $man = tdbmanager::i();
    $man->deletetable($self->table);
    if ($man->column_exists('users', 'phone')) {
        $man->alter('users', "drop phone");
    }
    $alogin = tadminlogin::i();
    $alogin->widget = $self->deletepanel($alogin->widget);
    $alogin->save();
    $areg = tadminreguser::i();
    $areg->widget = $self->deletepanel($areg->widget);
    $areg->save();
    $tc = ttemplatecomments::i();
    $tc->regaccount = $self->deletepanel($tc->regaccount);
    $tc->save();
    $js = tjsmerger::i();
    $js->lock();
    $js->deletefile('default', '/plugins/ulogin/resource/ulogin.popup.min.js');
    $js->deletefile('default', '/plugins/ulogin/resource/' . litepublisher::$options->language . '.ulogin.popup.min.js');
    $js->unlock();
    tcssmerger::i()->deletefile('default', '/plugins/ulogin/resource/ulogin.popup.css');
    tjsonserver::i()->unbind($self);
    litepublisher::$classes->delete('emailauth');
}
 public function processform()
 {
     $ulogin = ulogin::i();
     $ulogin->panel = trim($_POST['panel']);
     $ulogin->button = trim($_POST['button']);
     $ulogin->save();
     $alogin = tadminlogin::i();
     $alogin->widget = $ulogin->addpanel($alogin->widget, $ulogin->panel);
     $alogin->save();
     $areg = tadminreguser::i();
     $areg->widget = $ulogin->addpanel($areg->widget, $ulogin->panel);
     $areg->save();
     $tc = ttemplatecomments::i();
     $tc->regaccount = $ulogin->addpanel($tc->regaccount, $ulogin->button);
     $tc->save();
 }
Beispiel #4
0
function update597()
{
    litepublisher::$site->jquery_version = '1.11.2';
    litepublisher::$site->jqueryui_version = '1.11.4';
    litepublisher::$site->save();
    $js = tjsmerger::i();
    $js->lock();
    $js->after('default', '/js/plugins/jquery.cookie.min.js', '/js/plugins/tojson.min.js');
    $js->after('default', '/js/litepublisher/litepublisher.utils.min.js', '/js/litepublisher/ready2.min.js');
    $js->after('default', '/js/litepublisher/ready2.min.js', '/js/litepublisher/css-loader.min.js');
    $js->after('default', '/js/litepublisher/css-loader.min.js', '/js/litepublisher/json-rpc.min.js');
    $js->unlock();
    $css = tcssmerger::i();
    //$css->add('default', '/js/litepublisher/css/hover.css');
    if (litepublisher::$classes->exists('ulogin')) {
        $ulogin = ulogin::i();
        $ulogin->panel = str_replace(' ready2', ' $.ready2', $ulogin->panel);
        $ulogin->save();
        $alogin = tadminlogin::i();
        $alogin->widget = $ulogin->addpanel($alogin->widget, $ulogin->panel);
        $alogin->save();
        $areg = tadminreguser::i();
        $areg->widget = $ulogin->addpanel($areg->widget, $ulogin->panel);
        $areg->save();
        $tc = ttemplatecomments::i();
        $tc->regaccount = $ulogin->addpanel($tc->regaccount, $ulogin->button);
        $tc->save();
    }
    $t = ttemplate::i();
    $t->footer = str_replace('2014', '2015', $t->footer);
    $template = ttemplate::i();
    $t->data[$js->basename] = $js->revision;
    $t->data[$css->basename] = $css->revision;
    $t->save();
    //$a = tprefetchtxt::i()->items;
    $data = new tdata();
    $data->basename = 'prefetch.txt';
    $data->load();
    $a = $data->data['items'];
    litepublisher::$classes->delete('tprefetchtxt');
    litepublisher::$classes->add('appcache_manifest', 'appcache.manifest.class.php');
    $c = appcache_manifest::i();
    $c->items = $a;
    $c->save();
    tredirector::i()->add('/prefetch.txt', $c->url);
}
Beispiel #5
0
 public function gettemplatecomments()
 {
     return ttemplatecomments::i();
 }
 public function comments_get_logged(array $args)
 {
     if (!litepublisher::$options->user) {
         return $this->forbidden();
     }
     $mesg = ttemplatecomments::i()->logged;
     //unsafe, dangerous trick
     $mesg = str_replace('<?php echo litepublisher::$site->getuserlink(); ?>', litepublisher::$site->getuserlink(), $mesg);
     $a = new targs();
     return $a->parse($mesg);
 }
 public function processform()
 {
     extract($_POST, EXTR_SKIP);
     $options = litepublisher::$options;
     $cm = tcommentmanager::i();
     $cm->lock();
     $options->comstatus = $comstatus;
     $cm->filterstatus = isset($filterstatus);
     $cm->defstatus = isset($commentsapproved) ? 'approved' : 'hold';
     $cm->checkduplicate = isset($checkduplicate);
     $useroptions = tuseroptions::i();
     $useroptions->defvalues['subscribe'] = isset($defaultsubscribe) ? 'enabled' : 'disabled';
     $useroptions->defvalues['authorpost_subscribe'] = isset($authorpost_subscribe) ? 'enabled' : 'disabled';
     $useroptions->save();
     $options->commentsdisabled = isset($commentsdisabled);
     $options->pingenabled = isset($pingenabled);
     $options->commentpages = isset($commentpages);
     $options->commentsperpage = (int) trim($commentsperpage);
     $options->comments_invert_order = isset($comments_invert_order);
     $cm->sendnotification = isset($sendnotification);
     $cm->hidelink = isset($hidelink);
     $cm->redir = isset($redir);
     $cm->nofollow = isset($nofollow);
     $cm->comuser_subscribe = isset($comuser_subscribe);
     $cm->unlock();
     $tc = ttemplatecomments::i();
     foreach (array('logged', 'reqlogin', 'regaccount', 'guest', 'comuser', 'loadhold') as $name) {
         $tc->{$name} = $_POST[$name];
     }
     $tc->save();
     $subscr = tsubscribers::i();
     $subscr->lock();
     $subscr->locklist = $locklist;
     $subscr->enabled = isset($subscribe_enabled);
     $subscr->unlock();
     $rss = trssholdcomments::i();
     $rss->count = $rsscount;
     $rss->template = $rsstemplate;
     $rss->save();
 }