예제 #1
0
파일: helper.php 프로젝트: Ovi1/modules
 public static function getLatestProjects($total_row, $limit_title)
 {
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $now = JFactory::getDate();
     $query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project p " . "WHERE p.status=" . $db->quote('COM_JBLANCE_OPEN') . " AND p.approved=1  AND " . $db->quote($now) . " > p.start_date " . "ORDER BY p.is_featured DESC, p.id DESC " . "LIMIT 0," . (int) $total_row;
     $db->setQuery($query);
     $db->execute();
     $total = $db->getNumRows();
     $db->setQuery($query);
     $rows2 = $db->loadObjectList();
     $rows = null;
     if (count($rows2)) {
         $i = 0;
         foreach ($rows2 as $row) {
             $rows[$i] = new stdClass();
             $row->project_title = self::limitTitle($row->project_title, $limit_title);
             $rows[$i] = $row;
             $rows[$i]->categories = JblanceHelper::getCategoryNames($row->id_category);
             $rows[$i]->bids = self::countBids($row->id);
             $i++;
         }
     }
     return $rows;
 }
예제 #2
0
 function display($tpl = null)
 {
     // parameters
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $document = JFactory::getDocument();
     $params = $app->getParams();
     $feedEmail = @$app->get('feed_email') ? $app->get('feed_email') : 'author';
     $siteEmail = $app->get('mailfrom');
     $document->link = JRoute::_('index.php?option=com_jblance&view=project&layout=listproject');
     $now = JFactory::getDate();
     $config = JblanceHelper::getConfig();
     $limit = (int) $config->rssLimit;
     // Get some data from the model
     $app->input->set('limit', $app->get('feed_limit'));
     $rows = $this->get('Items');
     $query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project p " . "WHERE p.status=" . $db->quote('COM_JBLANCE_OPEN') . " AND p.approved=1 AND p.start_date < " . $db->quote($now) . " " . "ORDER BY p.is_featured DESC, p.id DESC " . "LIMIT " . $limit;
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     foreach ($rows as $row) {
         // strip html from feed item title
         $title = $this->escape($row->project_title);
         $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
         // url link to article
         $link = JRoute::_('index.php?option=com_jblance&view=project&layout=detailproject&id=' . $row->id);
         // strip html from feed item description text
         $description = strip_tags($row->description);
         //get the publisher info
         $publisherInfo = JFactory::getUser($row->publisher_userid);
         $author = $publisherInfo->username;
         // load individual item creator class
         $item = new JFeedItem();
         $item->title = $title;
         $item->link = $link;
         $item->description = $description;
         $item->date = $row->start_date;
         $item->category = JblanceHelper::getCategoryNames($row->id_category);
         $item->author = $author;
         if ($feedEmail == 'site') {
             $item->authorEmail = $siteEmail;
         } else {
             $item->authorEmail = $row->author_email;
         }
         // loads item info into rss array
         $document->addItem($item);
     }
 }
예제 #3
0
">shopping_cart</i> <?php 
echo $model->servicePurchaseCount($row->id);
?>
                        </li>

                    </ul>

                    <div class="clearfix"></div>
                    <div class="lineseparator"></div>
                    <div>
                        <h6 style="padding: 20px 0 0 0; margin-bottom: 5px; " class="fontupper font12"><?php 
echo JText::_('COM_JBLANCE_SIMILAR_SERVICES');
?>
</h6>
                        <div><?php 
echo JblanceHelper::getCategoryNames($row->id_category, 'tags-link', 'service');
?>
</div>
                    </div>
                </div>
                <div class="col-md-8">
<?php 
echo JBMediaHelper::renderImageCarousel($row->attachment, 'service');
?>

                </div>
                <div class="col-md-12">
                    <div class="clearfix"></div>
                    <div><?php 
echo nl2br($row->description);
?>
예제 #4
0
    ?>
:</h4>
                <div><?php 
    echo JblanceHelper::getProjectDuration($row->project_duration);
    ?>
</div>
                <?php 
}
?>

            <h4><?php 
echo JText::_('COM_JBLANCE_SKILLS_REQUIRED');
?>
:</h4>
            <div><?php 
echo JblanceHelper::getCategoryNames($row->id_category, 'tags-link', 'project');
?>
</div>

            <h4><?php 
echo JText::_('COM_JBLANCE_LOCATION');
?>
:</h4>
            <div><?php 
echo JblanceHelper::getLocationNames($row->id_location);
?>
</div><br>
            <?php 
//show map if the id_location is > 0
if ($row->id_location > 0) {
    $location = new JRegistry();
예제 #5
0
      <div class="clearfix"></div>
      <h4><?php 
echo JText::_('COM_JBLANCE_DESCRIPTION');
?>
:</h4>
      <p><?php 
echo nl2br($row->description);
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_SKILLS');
?>
:</h4>
      <p><?php 
echo JblanceHelper::getCategoryNames($row->id_category);
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_WEB_ADDRESS');
?>
:</h4>
      <p><?php 
echo !empty($row->link) ? $row->link : '<span class="redfont">' . JText::_('COM_JBLANCE_NOT_MENTIONED') . '</span>';
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_DURATION');
?>
예제 #6
0
    ?>
: </label>
                            <div class="input-group">
                                <?php 
    echo JblanceHelper::formatCurrency($this->userInfo->rate, true, true) . ' / ' . JText::_('COM_JBLANCE_HOUR');
    ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label nopadding"><?php 
    echo JText::_('COM_JBLANCE_SKILLS');
    ?>
: </label>
                            <div class="input-group">
                                <?php 
    echo JblanceHelper::getCategoryNames($this->userInfo->id_category);
    ?>
                            </div>
                        </div>
                    <?php 
}
?>
                    <div class="form-group">
                        <label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_AVERAGE_RATING');
?>
: </label>
                        <div class="input-group">
                            <?php 
$rate = JblanceHelper::getAvarageRate($this->userInfo->user_id, true);
?>