Exemplo n.º 1
0
}
?>
    <tbody>
      <?php 
foreach ($threads as $thread) {
    ?>
      <tr class='text-center'>
        <td><?php 
    echo $thread->id;
    ?>
</td>
        <td class='text-left'>
          <?php 
    $iconRoot = $themeRoot . 'default/images/forum/';
    echo $thread->isNew ? "<span class='new-board'>&nbsp;</span>" : "<span class='common-board'>&nbsp;</span>";
    echo html::a(commonModel::createFrontLink('thread', 'view', "threadID={$thread->id}"), $thread->title, "target='_blank'");
    ?>
        </td>
        <td><?php 
    echo $thread->authorRealname;
    ?>
</td>
        <td><?php 
    echo substr($thread->addedDate, 5, -3);
    ?>
</td>
        <td><?php 
    echo $thread->views;
    ?>
</td>
        <td><?php 
Exemplo n.º 2
0
        <td><?php 
    echo $order->id;
    ?>
</td>
        <td class='text-left'><?php 
    echo $order->account;
    ?>
</td>
        <td>
          <dl>
            <?php 
    foreach ($order->products as $product) {
        ?>
            <dd class='text-left'>
              <span><?php 
        echo html::a(commonModel::createFrontLink('product', 'view', "id={$product->productID}"), $product->productName, "target='_blank'");
        ?>
</span>
              <span><?php 
        echo $lang->order->price . $lang->colon . $product->price . ' ' . $lang->order->count . $lang->colon . $product->count;
        ?>
</span>
            </dd>
            <?php 
    }
    ?>
          </dl>
        </td>
        <td class='text-center'><?php 
    echo $order->amount;
    ?>
Exemplo n.º 3
0
 /**
  * Get the link of the object of one message.
  *
  * @param string $message
  * @access public
  * @return sting
  */
 public function getObjectLink($message)
 {
     $link = '';
     if ($message->objectType == 'article') {
         $link = $this->loadModel('article')->createPreviewLink($message->objectID);
     } elseif ($message->objectType == 'product') {
         $link = commonModel::createFrontLink('product', 'view', "prodcutID={$message->objectID}");
     } elseif ($message->objectType == 'book') {
         $node = $this->loadModel('book')->getNodeByID($message->objectID);
         $link = commonModel::createFrontLink('book', 'read', "articleID={$message->objectID}", "book={$node->book->alias}&node={$node->alias}");
     } elseif ($message->objectType == 'message') {
         $link = commonModel::createFrontLink('message', 'index') . "#comment{$message->objectID}";
     } elseif ($message->objectType == 'comment') {
         $object = $this->getByID($message->objectID);
         $link = $this->getObjectLink($object);
     }
     return $link;
 }
Exemplo n.º 4
0
 /**
  * Create preview link. 
  * 
  * @param  int    $articleID 
  * @access public
  * @return string
  */
 public function createPreviewLink($articleID)
 {
     $article = $this->getByID($articleID);
     if (empty($article)) {
         return null;
     }
     $module = $article->type;
     $param = "articleID={$articleID}";
     if ($article->type != 'page') {
         $categories = $article->categories;
         $categoryAlias = current($categories)->alias;
         $alias = "category={$categoryAlias}&name={$article->alias}";
     } else {
         $alias = "name={$article->alias}";
     }
     $link = commonModel::createFrontLink($module, 'view', $param, $alias);
     if ($article->link) {
         $link = $article->link;
     }
     return $link;
 }
Exemplo n.º 5
0
?>
</th>
      </tr>
    </thead>
    <tbody>
      <?php 
foreach ($replies as $reply) {
    ?>
      <tr class='text-center'>
        <td><?php 
    echo $reply->id;
    ?>
</td>
        <td class='text-left'>
          <?php 
    echo html::a(commonModel::createFrontLink('thread', 'locate', "threadID={$reply->thread}&replyID={$reply->id}"), $reply->content, "target=_blank");
    ?>
        </td>
        <td><?php 
    echo $reply->authorRealname;
    ?>
</td>
        <td><?php 
    echo substr($reply->createdDate, 5, -3);
    ?>
</td>
        <td>
          <?php 
    echo html::a($this->createLink('reply', 'delete', "replyID={$reply->id}"), $lang->delete, "class='reloadDeleter'");
    ?>
        </td>
Exemplo n.º 6
0
 /**
  * get url of a nav.
  *
  * @param  array $nav
  * @return string
  */
 public function getUrl($nav)
 {
     global $config;
     if ($nav->type == 'system') {
         return $config->nav->system->{$nav->system};
     }
     if ($nav->type == 'article') {
         $category = $this->loadModel('tree')->getByID($nav->article);
         if (empty($category)) {
             return commonModel::createFrontLink('article', 'index');
         }
         return commonModel::createFrontLink('article', 'browse', "categoryID={$nav->article}", "category={$category->alias}");
     }
     if ($nav->type == 'blog') {
         $category = $this->loadModel('tree')->getByID($nav->blog);
         if (empty($category)) {
             return commonModel::createFrontLink('blog', 'index');
         }
         return commonModel::createFrontLink('blog', 'index', "categoryID={$nav->blog}", "category={$category->alias}");
     }
     if ($nav->type == 'product') {
         $category = $this->loadModel('tree')->getByID($nav->product);
         if (empty($category)) {
             return commonModel::createFrontLink('product', 'index');
         }
         return commonModel::createFrontLink('product', 'browse', "categoryID={$nav->product}", "category={$category->alias}");
     }
     if ($nav->type == 'page') {
         $page = $this->loadModel('article')->getByID($nav->page);
         if (empty($page)) {
             return '';
         }
         return commonModel::createFrontLink('page', 'view', "pageID={$nav->page}", "name={$page->alias}");
     }
     return $nav->url;
 }
Exemplo n.º 7
0
$config->block->require->edit = 'title';
$config->block->categoryList = new stdclass();
$config->block->categoryList->custom = ',html,htmlcode,phpcode,';
$config->block->categoryList->article = ',latestArticle,hotArticle,latestBlog,latestThread,pageList,articleTree,blogTree,';
$config->block->categoryList->product = ',latestProduct,hotProduct,featuredProduct,productTree,';
$config->block->categoryList->system = ',contact,followUs,about,links,slide,header,';
$config->block->defaultIcons = array();
$config->block->defaultIcons['about'] = 'icon-group';
$config->block->defaultIcons['html'] = '';
$config->block->defaultIcons['contact'] = 'icon-phone';
$config->block->defaultIcons['followUs'] = 'icon-weixin';
$config->block->defaultIcons['links'] = 'icon-link';
$config->block->defaultIcons['latestArticle'] = 'icon-list-ul';
$config->block->defaultIcons['hotArticle'] = 'icon-list-ul';
$config->block->defaultIcons['latestBlog'] = 'icon-list-ul';
$config->block->defaultIcons['latestThread'] = 'icon-list-ul';
$config->block->defaultIcons['latestProduct'] = 'icon-th';
$config->block->defaultIcons['hotProduct'] = 'icon-th';
$config->block->defaultIcons['pageList'] = 'icon-list-ul';
$config->block->defaultIcons['articleTree'] = 'icon-folder-close';
$config->block->defaultIcons['productTree'] = 'icon-folder-close';
$config->block->defaultIcons['blogTree'] = 'icon-folder-close';
$config->block->defaultMoreUrl['html'] = '';
$config->block->defaultMoreUrl['latestArticle'] = '';
$config->block->defaultMoreUrl['hotArticle'] = '';
$config->block->defaultMoreUrl['latestProduct'] = '';
$config->block->defaultMoreUrl['hotProduct'] = '';
$config->block->defaultMoreUrl['latestThread'] = '';
$config->block->defaultMoreUrl['about'] = commonModel::createFrontLink('company', 'index');
$config->block->defaultMoreUrl['contact'] = commonModel::createFrontLink('company', 'index');
Exemplo n.º 8
0
    ?>
</td>
        <td><?php 
    echo $product->views;
    ?>
</td>
        <td>
          <?php 
    $categories = $product->categories;
    $categoryAlias = !empty($categories) ? current($categories)->alias : '';
    $changeStatus = $product->status == 'normal' ? 'offline' : 'normal';
    commonModel::printLink('product', 'edit', "productID={$product->id}", $lang->edit);
    commonModel::printLink('file', 'browse', "objectType=product&objectID={$product->id}&isImage=1", $lang->product->images, "data-toggle='modal' data-width='1000'");
    commonModel::printLink('file', 'browse', "objectType=product&objectID={$product->id}&isImage=0", $lang->product->files, "data-toggle='modal' data-width='1000'");
    commonModel::printLink('product', 'changeStatus', "productID={$product->id}&status={$changeStatus}", $lang->product->statusList[$changeStatus], "class='changeStatus'");
    echo html::a(commonModel::createFrontLink('product', 'view', "productID={$product->id}", "name={$product->alias}&category={$categoryAlias}"), $lang->preview, "target='_blank'");
    ?>
          <span class='dropdown'>
            <a data-toggle='dropdown' href='javascript:;'><?php 
    echo $this->lang->more;
    ?>
<span class='caret'></span></a>
            <ul class='dropdown-menu pull-right'>    
              <li><?php 
    commonModel::printLink('product', 'delete', "productID={$product->id}", $lang->delete, "class='deleter'");
    ?>
</li>
              <li><?php 
    commonModel::printLink('product', 'setcss', "productID={$product->id}", $lang->product->css, "data-toggle='modal'");
    ?>
</li>
Exemplo n.º 9
0
 /**
  * Parse products. 
  * 
  * @param  object    $content 
  * @access public
  * @return object
  */
 public function parseProducts($content)
 {
     $orderByList = array('latestProduct' => 'id_desc', 'hotProduct' => 'views_desc');
     $this->app->loadClass('pager', true);
     $pager = new pager($recTotal = 0, $recPerPage = $content->limit, 1);
     $products = $this->loadModel('product')->getList($content->category, $orderByList[$content->block], $pager);
     $response = new stdclass();
     $response->msgType = 'news';
     foreach ($products as $product) {
         $categories = $product->categories;
         $categoryAlias = current($categories)->alias;
         $article = new stdclass();
         $article->title = $product->name;
         $article->url = getHostURL() . commonModel::createFrontLink('product', 'view', "productID={$product->id}", "name={$product->alias}&category={$categoryAlias}");
         $article->description = isset($product->summary) ? $product->summary : '';
         if (!empty($product->image)) {
             $article->picUrl = rtrim(getWebRoot(true), '/') . $product->image->primary->smallURL;
         }
         $response->articles[] = $article;
     }
     return $response;
 }
Exemplo n.º 10
0
</td>
            </tr>
            <?php 
    }
    ?>
            <?php 
    if ($providerCode == 'qq') {
        ?>
            <tr>
              <th><?php 
        echo $lang->user->oauth->callbackURL;
        ?>
</th>
              <td>
                <?php 
        $callbackURL = commonModel::createFrontLink('user', 'oauthCallback', "provider=qq");
        ?>
                <?php 
        if ($callbackURL == '/user-oauthCallback-qq.html') {
            ?>
                <?php 
            echo commonModel::getSysURL() . $callbackURL;
            ?>
                <?php 
        } else {
            ?>
                <?php 
            echo commonModel::getSysURL() . '/index.php/user-oauthCallback-qq.html';
            ?>
                <?php 
        }
Exemplo n.º 11
0
if (!empty($categories)) {
    ?>
    <?php 
    foreach ($categories as $category) {
        ?>
    <li class='list-group-item'>
      <span class='label label-danger'>
        <?php 
        echo $category->type == 'forum' ? $lang->tag->sourceList['board'] : $lang->tag->sourceList['category'];
        ?>
      </span>
      <?php 
        $method = 'browse';
        if ($category->type == 'forum') {
            $method = 'board';
        }
        if ($category->type == 'blog') {
            $method = 'index';
        }
        echo html::a(commonModel::createFrontLink($category->type, $method, "categoryID={$category->id}", "category={$category->alias}"), $category->name, "target='_blank'");
        ?>
    </li>
    <?php 
    }
    ?>
    <?php 
}
?>
  </ul>
<?php 
include '../../common/view/footer.modal.html.php';
Exemplo n.º 12
0
 /**
  * transfer thread from one board to another.
  * 
  * @param  int    $threadID 
  * @param  int    $oldBoard 
  * @param  int    $tagetBoard 
  * @access public
  * @return void
  */
 public function transfer($threadID, $oldBoard, $targetBoard)
 {
     $oldThread = $this->getByID($threadID);
     $newThread = $oldThread;
     $newThread->board = $targetBoard;
     unset($newThread->id);
     unset($newThread->editorRealname);
     unset($newThread->authorRealname);
     unset($newThread->files);
     $this->dao->insert(TABLE_THREAD)->data($newThread)->autoCheck()->exec();
     $newThreadID = $this->dao->lastInsertID();
     $oldThread->board = $oldBoard;
     $oldThread->link = commonModel::createFrontLink('thread', 'view', "threadID={$newThreadID}");
     $this->dao->update(TABLE_THREAD)->data($oldThread)->where('id')->eq($threadID)->exec();
     if (dao::isError()) {
         return false;
     }
     $this->loadModel('forum')->updateBoardStats($oldBoard);
     $this->loadModel('forum')->updateBoardStats($targetBoard);
     return true;
 }
Exemplo n.º 13
0
      <?php 
}
?>
      <?php 
if (!empty($userHistory->replies)) {
    ?>
      <div class="panel-heading"><?php 
    echo $lang->user->replyHistory;
    ?>
</div>
      <div class="panel-body">
        <?php 
    foreach ($userHistory->replies as $reply) {
        ?>
        <?php 
        echo html::checkbox('replies', array($reply->id => html::a(commonModel::createFrontLink('thread', 'locate', "threadID={$reply->thread}&replyID={$reply->id}"), $reply->content, "class='list-group-item' target=_blank")), $reply->id);
        ?>
        <?php 
    }
    ?>
      </div>
      <?php 
}
?>
      <?php 
if (!empty($userHistory->comments)) {
    ?>
      <div class="panel-heading"><?php 
    echo $lang->user->commentHistory;
    ?>
</div>
Exemplo n.º 14
0
<?php

/**
 * The nav config file of chanzhiEPS. 
 * 
 * @copyright   Copyright 2013-2013 青岛息壤网络信息有限公司 (QingDao XiRang Network Infomation Co,LTD www.xirangit.com)
 * @license     http://api.chanzhi.org/goto.php?item=license
 * @author      Xiying Guan
 * @package     nav
 * @version     $Id$
 * @link        http://www.chanzhi.org
 */
$config->nav->system = new stdclass();
$config->nav->system->home = $config->webRoot;
$config->nav->system->company = commonModel::createFrontLink('company', 'index');
$config->nav->system->forum = commonModel::createFrontLink('forum', 'index');
$config->nav->system->blog = commonModel::createFrontLink('blog', 'index');
$config->nav->system->book = commonModel::createFrontLink('book', 'index');
$config->nav->system->message = commonModel::createFrontLink('message', 'index');