示例#1
0
 public function render($params = array())
 {
     // render widget
     if ($widget_id = (int) $this->get('value', $this->config->get('default'))) {
         // render output
         $output = $this->widgetkit['widget']->render($widget_id);
         return $output === false ? JText::printf("Could not load widget with the id %s.", $widget_id) : $output;
     }
 }
示例#2
0
 function OfflajnMenuThemeCache($namespace, &$_module, &$_params)
 {
     $this->cssCompress = 1;
     $this->jsCompress = 1;
     $this->js = array();
     $this->css = array();
     $this->module =& $_module;
     $this->params =& $_params;
     $this->env = array('params' => &$_params);
     $writeError = false;
     $folder = $this->module->id;
     $registry = JFactory::getConfig();
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $curLanguage = $registry->get("joomfish.language");
     } else {
         $curLanguage = $registry->getValue("joomfish.language");
     }
     if (is_object($curLanguage)) {
         $folder .= '-lang' . $curLanguage->get('lang_id');
     } else {
         if (is_string($curLanguage) && $curLanguage != '') {
             $folder .= '-lang' . $curLanguage;
         }
     }
     $this->cachePath = JPath::clean(JPATH_SITE . DS . 'modules' . DS . $this->module->module . DS . 'cache' . DS . $folder . DS);
     if (!JFolder::exists($this->cachePath)) {
         JFolder::create($this->cachePath, 0777);
     }
     if (!JFolder::exists($this->cachePath)) {
         $writeError = true;
     }
     if ($writeError) {
         JText::printf("%s is unwriteable or non-existent, because the system does not allow the operation from PHP. Please create the directory and set the writing access!", $this->cachePath);
         exit;
     }
     $this->cacheUrl = JURI::root(true) . '/modules/' . $this->module->module . '/cache/' . $folder . '/';
     $this->moduleUrl = JURI::root(true) . '/modules/' . $this->module->module . '/';
 }
示例#3
0
	protected function _Move($MessageID, $TargetCatID, $TargetSubject = '', $TargetMessageID = 0, $mode = KN_MOVE_MESSAGE, $GhostThread = false, $changesubject = false) {
		// Private move function
		// $mode
		// KN_MOVE_MESSAGE ... move current message only
		// KN_MOVE_THREAD  ... move entire thread
		// KN_MOVE_NEWER   ... move current message and all newer in current thread
		// KN_MOVE_REPLIES ... move current message and replies and quotes - 1 level deep
		//
		// if $TargetMessagID is a valid message ID, the messages will be appended to that thread


		// Reset error message
		$this->_ResetErrorMessage ();

		// Sanitize parameters!
		$MessageID = intval ( $MessageID );
		$TargetCatID = intval ( $TargetCatID );
		$TargetMessageID = intval ( $TargetMessageID );
		$mode = intval ( $mode );
		// no need to check $GhostThread as we only test for true

		// Always check security clearance before taking action!

		// Assumption: only moderators can move messages
		// This test is made to prevent user to guess existing message ids
		if ( !$this->_me->isModerator() ) {
			$this->_errormsg = JText::_('COM_KUNENA_MODERATION_ERROR_NOT_MODERATOR');
			return false;
		}

		$query = "SELECT m.id, m.catid, m.parent, m.name, m.userid, m.thread, m.subject , p.id AS poll
				FROM #__kunena_messages AS m
				LEFT JOIN #__kunena_polls AS p ON p.threadid=m.thread
				WHERE m.id={$this->_db->Quote($MessageID)}";
		$this->_db->setQuery ( $query );
		$currentMessage = $this->_db->loadObject ();
		if (KunenaError::checkDatabaseError()) return false;

		// Check that message to be moved actually exists
		if ( !is_object($currentMessage) ) {
			$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_MESSAGE_NOT_FOUND', $MessageID);
			return false;
		}

		if ($mode == KN_MOVE_THREAD && $currentMessage->parent != 0) {
			// When moving a thread, message has to point into first message
			$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_NOT_TOPIC', $currentMessage->id);
			return false;
		}

		// Check that thread can't be move into a section
		$category = KunenaForumCategoryHelper::get($TargetCatID);
		if ( $category->isSection() ) {
			$this->_errormsg = JText::_('COM_KUNENA_MODERATION_ERROR_NOT_MOVE_SECTION');
			return false;
		}

		// Check that user has moderator permissions in source category
		if ( !$this->_me->isModerator($currentMessage->catid) ) {
			$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_NOT_MODERATOR_IN_CATEGORY', $currentMessage->id, $currentMessage->catid);
			return false;
		}

		// Check that we have target category or message
		if ($TargetCatID == 0 && $TargetMessageID == 0) {
			$this->_errormsg = JText::printf('COM_KUNENA_MODERATION_ERROR_NO_TARGET', $currentMessage->id);
			return false;
		}

		if ($TargetMessageID != 0) {
			// Check that target message actually exists
			$this->_db->setQuery ( "SELECT m.id, m.catid, m.parent, m.thread, m.subject, p.id AS poll FROM #__kunena_messages AS m LEFT JOIN #__kunena_polls AS p ON p.threadid=m.thread WHERE m.id={$this->_db->Quote($TargetMessageID)}" );
			$targetMessage = $this->_db->loadObject ();
			if (KunenaError::checkDatabaseError()) return false;

			if ( !is_object( $targetMessage )) {
				// Target message not found. Cannot proceed with move
				$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_TARGET_MESSAGE_NOT_FOUND', $currentMessage->id, $TargetMessageID);
				return false;
			}

			if ($targetMessage->thread == $currentMessage->thread) {
				// Recursive self moves not supported
				$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_SAME_TARGET_THREAD', $currentMessage->id, $currentMessage->thread);
				return false;
			}

			// If $TargetMessageID has been specified and is valid,
			// overwrite $TargetCatID with the category ID of the target message
			$TargetCatID = $targetMessage->catid;
		}

		// Check that target category exists and is visible to our moderator
		if (! in_array ( $TargetCatID, $this->_allowed ) ) {
			//the user haven't moderator permissions in target category
			$this->_errormsg = JText::sprintf('COM_KUNENA_MODERATION_ERROR_TARGET_CATEGORY_NOT_FOUND', $currentMessage->id, $TargetCatID);
			return false;
		}

		// Special case if the first message is moved in case 2 or 3
		if ($mode != KN_MOVE_MESSAGE && $currentMessage->parent == 0)
			$mode = KN_MOVE_THREAD;

		// Moving first message is a special case: handle it separately to other messages
		if ($TargetMessageID == 0) {
			$TargetThreadID = $MessageID;
			$TargetParentID = 0;
		} else {
			$TargetThreadID = $targetMessage->thread;
			$TargetParentID = $currentMessage->parent ? $currentMessage->parent : $TargetMessageID;
		}
		// partial logic to update target subject if specified
		$subjectupdatesql = !empty($TargetSubject) || ( $mode == 'KN_MOVE_THREAD' && $changesubject ) ? ",`subject`={$this->_db->quote($TargetSubject)}" : "";
		if($mode == 'KN_MOVE_THREAD' && $changesubject) $subjectupdatesqlreplies = ",`subject`={$this->_db->quote($TargetSubject)}";
		else $subjectupdatesqlreplies = "";

		$sql = "UPDATE #__kunena_messages SET `catid`={$this->_db->Quote($TargetCatID)}, `thread`={$this->_db->Quote($TargetThreadID)}, `parent`={$this->_db->Quote($TargetParentID)} {$subjectupdatesql} WHERE `id`={$this->_db->Quote($MessageID)}";
		$this->_db->setQuery ( $sql );
		$this->_db->query ();
		if (KunenaError::checkDatabaseError()) return false;

		// Assemble move logic based on $mode
		switch ($mode) {
			case KN_MOVE_MESSAGE : // Move Single message only
				// If we are moving the first message of a thread only - make the second post the new thread header
				if ( $currentMessage->parent == 0 ) {
					if ( !empty($currentMessage) && !empty($targetMessage) )
						$this->_handlePolls($currentMessage, $targetMessage);
					// We are about to pull the thread starter from the original thread.
					// Need to promote the second post of the original thread as the new starter.
					$sqlnewparent = "SELECT `id` FROM #__kunena_messages WHERE `id`!={$this->_db->Quote($MessageID)} AND `thread`={$this->_db->Quote($currentMessage->thread)} ORDER BY `id` ASC";
					$this->_db->setQuery ( $sqlnewparent, 0, 1 );
					$newParentID = $this->_db->loadResult ();
					if (KunenaError::checkDatabaseError()) return false;

					if ( $newParentID ) {
						$this->_Move ( $newParentID, $currentMessage->catid, '', 0, KN_MOVE_NEWER );
					}

					// Create ghost thread if requested
					if ($GhostThread == true) {
						$this->createGhostThread($MessageID,$currentMessage);
					}
				}

				break;
			case KN_MOVE_THREAD :
				// Move entire Thread
				$sql = "UPDATE #__kunena_messages SET `catid`={$this->_db->Quote($TargetCatID)}, `thread`={$this->_db->Quote($TargetThreadID)} {$subjectupdatesqlreplies} WHERE `thread`={$this->_db->Quote($currentMessage->thread)}";

				// Create ghost thread if requested
				if ($GhostThread == true) {
					$this->createGhostThread($MessageID,$currentMessage);
				}

				if ( !empty($currentMessage) && !empty($targetMessage) )	$this->_handlePolls($currentMessage, $targetMessage);

				break;
			case KN_MOVE_NEWER :
				// Move message and all newer messages of thread
				$sql = "UPDATE #__kunena_messages SET `catid`={$this->_db->Quote($TargetCatID)}, `thread`={$this->_db->Quote($TargetThreadID)} WHERE `thread`={$this->_db->Quote($currentMessage->thread)} AND `id`>{$this->_db->Quote($MessageID)}";

				if ( !empty($currentMessage) && !empty($targetMessage) )	$this->_handlePolls($currentMessage, $targetMessage);

				break;
			case KN_MOVE_REPLIES :
				// Move message and all replies and quotes - 1 level deep for now
				$sql = "UPDATE #__kunena_messages SET `catid`={$this->_db->Quote($TargetCatID)}, `thread`={$this->_db->Quote($TargetThreadID)} WHERE `thread`={$this->_db->Quote($currentMessage->thread)} AND `parent`={$this->_db->Quote($MessageID)}";

				if ( !empty($currentMessage) && !empty($targetMessage) )	$this->_handlePolls($currentMessage, $targetMessage);

				break;
			default :
				// Unsupported mode - Error!
				$this->_errormsg = JText::_('COM_KUNENA_MODERATION_ERROR_UNSUPPORTED_MODE');

				return false;
		}

		// Execute move
		if (isset($sql)) {
			$this->_db->setQuery ( $sql );
			$this->_db->query ();
			if (KunenaError::checkDatabaseError()) return false;
		}

		// When done log the action
		$this->_Log ( 'Move', $MessageID, $TargetCatID, $TargetSubject, $TargetMessageID, $mode );

		// Last but not least update forum stats
		kimport('kunena.forum.category.helper');
		KunenaForumCategoryHelper::recount ();

		return true;
	}
示例#4
0
文件: text.php 项目: adjaika/J3Base
 /**
  * Helper wrapper method for printf
  *
  * @param   format  $string  The format string.
  *
  * @return  mixed
  *
  * @see     JText::printf
  * @since   3.4
  */
 public function printf($string)
 {
     return JText::printf($string);
 }
示例#5
0
        }
        ?>
			<?php 
        echo $created;
        ?>
		</dd>
	<?php 
    }
    ?>

	<?php 
    if ($this->params->get('show_author') && $this->article->author != "") {
        ?>
		<dd class="createdby">
			<?php 
        $this->escape(JText::printf($this->escape($this->article->created_by_alias) ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author)));
        ?>
		</dd>
	<?php 
    }
    ?>
	
	<?php 
    if ($this->params->get('show_hits')) {
        ?>
	<dd class="hits">        
		<?php 
        echo JText::_('Hits');
        ?>
: <?php 
        echo $this->article->hits;
示例#6
0
    foreach ($upgradeRules as $rule) {
        $upgradeOptionCount++;
        ?>
                                                <li class="osm-upgrade-option">
                                                    <input type="radio" class="validate[required]" id="upgrade_option_id_<?php 
        echo $upgradeOptionCount;
        ?>
" name="upgrade_option_id" value="<?php 
        echo $rule->id;
        ?>
" />												
                                                    <label for="upgrade_option_id_<?php 
        echo $upgradeOptionCount;
        ?>
"><?php 
        JText::printf('OSM_UPGRADE_OPTION_TEXT', $plans[$rule->from_plan_id]->title, $plans[$rule->to_plan_id]->title, OSMembershipHelper::formatCurrency($rule->price, $this->config));
        ?>
</label>
                                                </li>
                                            <?php 
    }
    ?>
	
                                    </ul>												
                                    <div class="form-actions">
                                        <input type="submit" class="btn btn-primary" value="<?php 
    echo JText::_('OSM_PROCESS_UPGRADE');
    ?>
"/>
                                    </div>							
                                <?php 
示例#7
0
 /**
  * Move topic or parts of it into another category or topic.
  *
  * @param   object  $target        Target KunenaForumCategory or KunenaForumTopic
  * @param   mixed   $ids           false, array of message Ids or JDate
  * @param   bool    $shadow        Leave visible shadow topic.
  * @param   string  $subject       New subject
  * @param   bool    $subjectall    Change subject from every message
  * @param   int     $topic_iconid  Define a new topic icon
  *
  * @return 	bool|KunenaForumCategory|KunenaForumTopic	Target KunenaForumCategory or KunenaForumTopic or false on failure
  */
 public function move($target, $ids = false, $shadow = false, $subject = '', $subjectall = false, $topic_iconid = null)
 {
     // Warning: logic in this function is very complicated and even with full understanding its easy to miss some details!
     // Clear authentication cache
     $this->_authfcache = $this->_authccache = $this->_authcache = array();
     // Cleanup input
     if (!$ids instanceof JDate) {
         if (!is_array($ids)) {
             $ids = explode(',', (string) $ids);
         }
         $mesids = array();
         foreach ($ids as $id) {
             $mesids[(int) $id] = (int) $id;
         }
         unset($mesids[0]);
         $ids = implode(',', $mesids);
     }
     $subject = (string) $subject;
     // First we need to check if there will be messages left in the old topic
     if ($ids) {
         $query = new KunenaDatabaseQuery();
         $query->select('COUNT(*)')->from('#__kunena_messages')->where("thread={$this->id}");
         if ($ids instanceof JDate) {
             // All older messages will remain (including unapproved, deleted)
             $query->where("time<{$ids->toUnix()}");
         } else {
             // All messages that were not selected will remain
             $query->where("id NOT IN ({$ids})");
         }
         $this->_db->setQuery($query);
         $oldcount = (int) $this->_db->loadResult();
         if ($this->_db->getErrorNum()) {
             $this->setError($this->_db->getError());
             return false;
         }
         // So are we moving the whole topic?
         if (!$oldcount) {
             $ids = '';
         }
     }
     $categoryFrom = $this->getCategory();
     // Find out where we are moving the messages
     if (!$target || !$target->exists()) {
         $this->setError(JText::printf('COM_KUNENA_MODERATION_ERROR_NO_TARGET', $this->id));
         return false;
     } elseif ($target instanceof KunenaForumTopic) {
         // Move messages into another topic (original topic will always remain, either as real one or shadow)
         if ($target == $this) {
             // We cannot move topic into itself
             $this->setError(JText::sprintf('COM_KUNENA_MODERATION_ERROR_SAME_TARGET_THREAD', $this->id, $this->id));
             return false;
         }
         if ($this->moved_id) {
             // Moved topic cannot be merged with another topic -- it has no posts to be moved
             $this->setError(JText::sprintf('COM_KUNENA_MODERATION_ERROR_ALREADY_SHADOW', $this->id));
             return false;
         }
         if ($this->poll_id && $target->poll_id) {
             // We cannot currently have 2 polls in one topic -- fail
             $this->setError(JText::_('COM_KUNENA_MODERATION_CANNOT_MOVE_TOPIC_WITH_POLL_INTO_ANOTHER_WITH_POLL'));
             return false;
         }
         if ($subjectall) {
             $subject = $target->subject;
         }
     } elseif ($target instanceof KunenaForumCategory) {
         // Move messages into category
         if ($target->isSection()) {
             // Section cannot have any topics
             $this->setError(JText::_('COM_KUNENA_MODERATION_ERROR_NOT_MOVE_SECTION'));
             return false;
         }
         // Save category information for later use
         $categoryTarget = $target;
         if ($this->moved_id) {
             // Move shadow topic and we are done
             $this->category_id = $categoryTarget->id;
             if ($subject) {
                 $this->subject = $subject;
             }
             $this->save(false);
             return $target;
         }
         if ($shadow || $ids) {
             // Create new topic for the moved messages
             $target = clone $this;
             $target->exists(false);
             $target->id = 0;
             $target->hits = 0;
             $target->params = '';
         } else {
             // If we just move into another category, we can keep using the old topic
             $target = $this;
         }
         // Did user want to change the subject?
         if ($subject) {
             $target->subject = $subject;
         }
         // Did user want to change the topic icon?
         if (!is_null($topic_iconid)) {
             $target->icon_id = $topic_iconid;
         }
         // Did user want to change category?
         $target->category_id = $categoryTarget->id;
     } else {
         $this->setError(JText::_('COM_KUNENA_MODERATION_ERROR_WRONG_TARGET'));
         return false;
     }
     // For now on we assume that at least one message will be moved (=authorization check was called on topic/message)
     // We will soon need target topic id, so save if it doesn't exist
     if (!$target->exists()) {
         if (!$target->save(false)) {
             $this->setError($target->getError());
             return false;
         }
     }
     // Move messages (set new category and topic)
     $query = new KunenaDatabaseQuery();
     $query->update('#__kunena_messages')->set("catid={$target->category_id}")->set("thread={$target->id}")->where("thread={$this->id}");
     // Did we want to change subject from all the messages?
     if ($subjectall && !empty($subject)) {
         $query->set("subject={$this->_db->quote($subject)}");
     }
     if ($ids instanceof JDate) {
         // Move all newer messages (includes unapproved, deleted messages)
         $query->where("time>={$ids->toUnix()}");
     } elseif ($ids) {
         // Move individual messages
         $query->where("id IN ({$ids})");
     }
     $this->_db->setQuery($query);
     $this->_db->query();
     if ($this->_db->getErrorNum()) {
         $this->setError($this->_db->getError());
         return false;
     }
     // Make sure that all messages in topic have unique time (deterministic without ORDER BY time, id)
     $query = "SET @ktime:=0";
     $this->_db->setQuery($query);
     $this->_db->query();
     if ($this->_db->getErrorNum()) {
         $this->setError($this->_db->getError());
         return false;
     }
     $query = "UPDATE #__kunena_messages SET time=IF(time<=@ktime,@ktime:=@ktime+1,@ktime:=time) WHERE thread={$target->id} ORDER BY time ASC, id ASC";
     $this->_db->setQuery($query);
     $this->_db->query();
     if ($this->_db->getErrorNum()) {
         $this->setError($this->_db->getError());
         return false;
     }
     // If all messages were moved into another topic, we need to move poll as well
     if ($this->poll_id && !$ids && $target != $this) {
         // Note: We may already have saved cloned target (having poll_id already in there)
         $target->poll_id = $this->poll_id;
         // Note: Do not remove poll from shadow: information could still be used to show icon etc
         $query = "UPDATE #__kunena_polls SET `threadid`={$this->_db->Quote($target->id)} WHERE `threadid`={$this->_db->Quote($this->id)}";
         $this->_db->setQuery($query);
         $this->_db->query();
         if ($this->_db->getErrorNum()) {
             $this->setError($this->_db->getError());
             return false;
         }
     }
     // When moving only first message keep poll only on target topic
     if ($this->poll_id && $target != $this && $ids) {
         if ($ids && $this->first_post_id) {
             $this->poll_id = 0;
         }
     }
     if (!$ids && $target != $this) {
         // Leave shadow from old topic
         $this->moved_id = $target->id;
         if (!$shadow) {
             // Mark shadow topic as deleted
             $this->hold = 2;
         }
     }
     // Note: We already saved possible target earlier, now save only $this
     if (!$this->save(false)) {
         return false;
     }
     if (!$ids && !empty($categoryTarget)) {
         // Move topic into another category
         // Update user topic information (topic, category)
         KunenaForumTopicUserHelper::move($this, $target);
         // TODO: do we need this?
         //KunenaForumTopicUserReadHelper::move($this, $target);
         // Remove topic and posts from the old category
         $categoryFrom->update($this, -1, -$this->posts);
         // Add topic and posts into the new category
         $categoryTarget->update($target, 1, $this->posts);
     } elseif (!$ids) {
         // Moving topic into another topic
         // Add new posts, hits and attachments into the target topic
         $target->posts += $this->posts;
         $target->hits += $this->hits;
         $target->attachments += $this->attachments;
         // Update first and last post information into the target topic
         $target->updatePostInfo($this->first_post_id, $this->first_post_time, $this->first_post_userid, $this->first_post_message, $this->first_post_guest_name);
         $target->updatePostInfo($this->last_post_id, $this->last_post_time, $this->last_post_userid, $this->last_post_message, $this->last_post_guest_name);
         // Save target topic
         if (!$target->save(false)) {
             $this->setError($target->getError());
             return false;
         }
         // Update user topic information (topic, category)
         KunenaForumTopicUserHelper::merge($this, $target);
         // TODO: do we need this?
         //KunenaForumTopicUserReadHelper::merge($this, $target);
         // Remove topic and posts from the old category
         $this->getCategory()->update($this, -1, -$this->posts);
         // Add posts into the new category
         $target->getCategory()->update($target, 0, $this->posts);
     } else {
         // Both topics have changed and we have no idea how much: force full recount
         // TODO: we can do this faster..
         $this->recount();
         $target->recount();
     }
     return $target;
 }
示例#8
0
        ?>
	<span class="createdate">
		<?php 
        echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'));
        ?>
	</span>
<?php 
    }
    ?>

<?php 
    if ($this->item->params->get('show_author') && $this->item->author != "") {
        ?>
	<span class="createby">
		<?php 
        JText::printf($this->item->created_by_alias ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author));
        ?>
	</span>
<?php 
    }
    ?>

<?php 
    if ($this->item->params->get('show_section') && $this->item->sectionid || $this->item->params->get('show_category') && $this->item->catid) {
        ?>
	<?php 
        if ($this->item->params->get('show_section') && $this->item->sectionid && isset($this->item->section)) {
            ?>
	<span class="article-section">
		<?php 
            if ($this->item->params->get('link_section')) {
示例#9
0
                if ($item->show_readmore) {
                    echo JText::_('more');
                }
                echo "</div>";
            }
            if ($order[$j] == "d" && $item->show_date) {
                echo "<div class=\"thumbsup-date" . $item->css . "\">" . JHTML::_('date', $item->created, $item->date_f) . "</div>";
            }
            if ($order[$j] == "a" && $item->show_author) {
                echo "<div class=\"thumbsup-author" . $item->css . "\">";
                JText::printf('Written by', $item->author);
                echo "</div>";
            }
            if ($order[$j] == "h" && $item->show_hits) {
                echo "<div class=\"thumbsup-hits" . $item->css . "\">";
                JText::printf('Hits', $item->hits);
                echo " " . $item->hits;
                echo "</div>";
            }
        }
        ?>
	</td>
	<?php 
        if ($list[1]->disposition == "v" || !$list[1]->disposition) {
            print "</tr>";
        }
    }
    $i++;
}
if ($list[1]->disposition == "h") {
    print "</tr>";
* @email		admin@vinaora.com
* 
* @warning		DON'T EDIT OR DELETE LINK HTTP://VINAORA.COM ON THE FOOTER OF MODULE. PLEASE CONTACT ME IF YOU WANT.
*
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$vvisit_path = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_vvisit_counter" . DS . "helpers";
$vvisit_exists = file_exists($vvisit_path . DS . "vinaora_visitors_counter.php") && file_exists($vvisit_path . DS . "browsers.php") && file_exists($vvisit_path . DS . "datetime.php");
if ($vvisit_exists) {
    require_once $vvisit_path . DS . "vinaora_visitors_counter.php";
    require_once $vvisit_path . DS . "browsers.php";
    require_once $vvisit_path . DS . "datetime.php";
} else {
    echo $vvisit_path;
    echo JText::printf("Please reinstall [Vinaora Visitors Counter] component");
    return;
}
require_once dirname(__FILE__) . DS . 'helper.php';
/* ------------------------------------------------------------------------------------------------ */
// Read our Parameters
$mode = @$params->get('mode', 'full');
$today = @$params->get('today', 'Today');
$yesterday = @$params->get('yesterday', 'Yesterday');
$x_week = @$params->get('week', 'This week');
$l_week = @$params->get('lweek', 'Last week');
$x_month = @$params->get('month', 'This month');
$l_month = @$params->get('lmonth', 'Last month');
$all = @$params->get('all', 'All days');
$beginday = @$params->get('beginday', '');
$online = @$params->get('online', 'Online Now: ');
示例#11
0
    ?>
			<span class="modified">
				<?php 
    echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2')));
    ?>
			</span>
			<?php 
}
?>
	
			<?php 
if ($this->item->params->get('show_author') && $this->item->author != "") {
    ?>
			<span class="author">
				<?php 
    JText::printf('Written by', $this->escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author));
    ?>
			</span>
			<?php 
}
?>
	
			<?php 
if ($this->item->params->get('show_url') && $this->item->urls) {
    ?>
			<span class="url">
				<a href="http://<?php 
    echo $this->escape($this->item->urls);
    ?>
" target="_blank"><?php 
    echo $this->escape($this->item->urls);
示例#12
0
 /**
  * Check in module
  * 
  * @param:	Int	$moduleid index of module in database
  * 
  */
 public static function checkin($moduleid)
 {
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->update("#__modules");
     $query->set("checked_out = '0'");
     $query->set("checked_out_time = ''");
     $query->where("id = " . $db->Quote($moduleid));
     $db->setQuery($query);
     if (!$db->query()) {
         JText::printf('MSG_AJAX_ERROR', $db->getErrorMsg());
         return false;
     }
     return true;
 }
示例#13
0
			<div class="rt-articleinfo-text">
				<?php /** Begin Created Date **/ if ($this->item->params->get('show_create_date')) : ?>
				<span class="rt-date-posted">
					<?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3')); ?>
				</span>
				<?php /** End Created Date **/ endif; ?>

				<?php /** Begin Modified Date **/ if ( intval($this->item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?>
				<span class="rt-date-modified">
					<?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
				</span>
				<?php /** End Modified Date **/ endif; ?>

				<?php /** Begin Author **/ if (($this->item->params->get('show_author')) && ($this->item->author != "")) : ?>
				<span class="rt-author">
					<?php JText::printf(($this->escape($this->item->created_by_alias) ? $this->item->created_by_alias : $this->escape($this->item->author)) ); ?>
				</span>
				<?php /** End Author **/ endif; ?>

				<?php /** Begin Url **/ if ($this->item->params->get('show_url') && $this->item->urls) : ?>
				<span class="rt-url">
					<a href="http://<?php echo $this->escape($this->item->urls) ; ?>" target="_blank"><?php echo $this->escape($this->item->urls); ?></a>
				</span>
				<?php /** End Url **/ endif; ?>
			</div>
			<?php /** Begin Article Icons **/ if ($canEdit || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon')) : ?>
			<div class="rt-article-icons">
				<?php if ($this->item->params->get('show_pdf_icon')) :
					echo RokIcon::pdf($this->item, $this->item->params, $this->access);
				endif;
				if ($this->item->params->get('show_print_icon')) :
示例#14
0
    }
    ?>
	</td>
</tr>
<?php 
}
?>

<?php 
if ($this->item->params->get('show_author') && $this->item->author != "") {
    ?>
<tr>
	<td width="70%"  valign="top" colspan="2">
		<span class="small">
			<?php 
    JText::printf('WRITTEN_BY', $this->escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author));
    ?>
		</span>
		&nbsp;&nbsp;
	</td>
</tr>
<?php 
}
?>

<?php 
if ($this->item->params->get('show_create_date')) {
    ?>
<tr>
	<td valign="top" colspan="2" class="createdate">
		<?php 
示例#15
0
                break;
        }
        ?>
					<li class="osm-renew-option">
						<input type="radio" class="validate[required] inputbox" id="renew_option_id_<?php 
        echo $renewOptionCount;
        ?>
" name="renew_option_id" value="<?php 
        echo $planId;
        ?>
" />												
						<label for="renew_option_id_<?php 
        echo $renewOptionCount;
        ?>
"><?php 
        JText::printf('OSM_RENEW_OPTION_TEXT', $plan->title, $length . ' ' . $text, OSMembershipHelper::formatCurrency($plan->price, $this->config));
        ?>
</label>
					</li>
				<?php 
    }
}
?>
	
	</ul>						
	<div class="form-actions">
		<input type="submit" class="btn btn-primary" value="<?php 
echo JText::_('OSM_PROCESS_RENEW');
?>
"/>
	</div>		
        <?php 
            echo JText::_('Last Updated') . ' (' . JHTML::_('date', $article->modified, JText::_('DATE_FORMAT_LC2')) . ')';
            ?>

    </span>
    <?php 
        }
        ?>

    <?php 
        if ($cparams->get('show_author') && $article->author != "") {
            ?>

    <span class="createdby">
        <?php 
            JText::printf('Written by', $article->created_by_alias ? $article->created_by_alias : $article->author);
            ?>

    </span>
    <?php 
        }
        ?>

    <?php 
        if ($cparams->get('show_create_date')) {
            ?>

    <span class="createdate">
        <?php 
            echo JHTML::_('date', $article->created, JText::_('DATE_FORMAT_LC2'));
            ?>
示例#17
0
 public function loadCSVFile()
 {
     $app = JFactory::getApplication();
     $file = $app->input->files->get('file');
     if ($file) {
         $dataCSV = $app->getUserState('csv.dataCSV');
         if (!JFile::copy($file['tmp_name'], $dataCSV['csv_import_dir'] . $file['name'])) {
             $this->setError(JText::printf("COM_JUDIRECTORY_CSV_PROCESS_FAIL_TO_COPY_S_TO_S_FILE", $file['tmp_name'], $dataCSV['csv_import_dir'] . $file['name']));
             return false;
         }
         $dataCSV['csv_file_path'] = $dataCSV['csv_import_dir'] . $file['name'];
         $delimiter = $app->input->post->getString('delimiter', ',');
         $dataCSV['csv_delimiter'] = $delimiter;
         $enclosure = $app->input->post->getString('enclosure', '"');
         $dataCSV['csv_enclosure'] = $enclosure;
         $app->setUserState('csv.dataCSV', $dataCSV);
     }
     $dataCSV = $app->getUserState('csv.dataCSV');
     if (!isset($dataCSV['csv_file_path']) || !JFile::exists($dataCSV['csv_file_path'])) {
         $this->setError(JText::_('COM_JUDIRECTORY_CSV_FILE_NOT_FOUND'));
         return false;
     }
     if (strtolower(JFile::getExt($dataCSV['csv_file_path'])) != 'csv') {
         $this->setError(JText::_('COM_JUDIRECTORY_CSV_FILE_IS_INVALID'));
         return false;
     }
     $csvRows = JUDirectoryHelper::getCSVData($dataCSV['csv_file_path'], $dataCSV['csv_delimiter'], $dataCSV['csv_enclosure'], 'r+', 0, null, true);
     if ($csvRows === false) {
         $this->setError(JText::_('COM_JUDIRECTORY_CSV_CANNOT_READ_FILE'));
         return false;
     }
     return true;
 }
示例#18
0
    ?>
        <div id="j-main-container">
    <?php 
}
?>
    
    
    <div class="jdlists-header-info"><?php 
echo '<img align="left" src="' . JURI::root() . 'administrator/components/com_jdownloads/assets/images/info22.png" width="22" height="22" border="0" alt="" />&nbsp;&nbsp;' . JText::_('COM_JDOWNLOADS_UPLOADER_DESC') . '<br /><br />' . JText::_('COM_JDOWNLOADS_UPLOADER_DESC2');
?>
 </div>
    <div class="clr"> </div>    
    
    <div id="uploader">
		<p><?php 
JText::printf('COM_JDOWNLOADS_ERROR_RUNTIME_NOT_SUPORTED', $this->runtime);
?>
</p>
	</div>
    <!-- we need here the 'task' field to get NOT an error message like: 'TypeError: b.task is undefined' -->
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="<?php 
echo JSession::getFormToken();
?>
" value="1" />
</form>
<?php 
if ($this->enableLog) {
    ?>
<button id="log_btn"><?php 
    echo JText::_('COM_JDOWNLOADS_UPLOADER_LOG_BTN');
示例#19
0
<div class="PostHeaderIcons metadata-icons">
<?php 
if ($this->item->params->get('show_create_date')) {
    ob_start();
    echo JHTML::_('image.site', 'PostDateIcon.png', null, null, null, JText::_("PostDateIcon"), array('width' => '17', 'height' => '18'));
    ?>
 <?php 
    echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'));
    $metadata[] = ob_get_clean();
}
if ($this->item->params->get('show_author') && $this->item->author != "") {
    ob_start();
    echo JHTML::_('image.site', 'PostAuthorIcon.png', null, null, null, JText::_("PostAuthorIcon"), array('width' => '14', 'height' => '14'));
    ?>
 <?php 
    JText::printf('Author: %s', $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author);
    $metadata[] = ob_get_clean();
}
?>

<?php 
if ($this->item->params->get('show_url') && $this->item->urls) {
    $metadata[] = '<a href="http://' . $this->item->urls . '" target="_blank">' . $this->item->urls . '</a>';
}
$joomlaIcons = array();
if ($this->item->params->get('show_pdf_icon')) {
    $joomlaIcons[] = JHTML::_('icon.pdf', $this->item, $this->item->params, $this->access);
}
if ($this->item->params->get('show_print_icon')) {
    $joomlaIcons[] = JHTML::_('icon.print_popup', $this->item, $this->item->params, $this->access);
}
示例#20
0
 /**
  * 
  * Unpublish module
  */
 public function unpublish()
 {
     $moduleid = JRequest::getVar('moduleid', array(), 'post', 'array');
     $count = count($moduleid);
     for ($i = 0; $i < $count; $i++) {
         JSNModules::unpublish($moduleid[$i]);
     }
     if ($count == 1) {
         JText::printf('MSG_AJAX_PUBLISHING_MODULE', '"' . JSNModules::getNameOfModule($moduleid[0]) . '"', 'published');
     } else {
         JText::printf('MSG_AJAX_MULTIPLE_PUBLISHING', $count, 'published');
     }
     jexit();
 }
示例#21
0
        ?>
	<span class="modifydate">
		<?php 
        echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2')));
        ?>
	</span>
	<?php 
    }
    ?>

	<?php 
    if ($this->params->get('show_author') && $this->article->author != "") {
        ?>
	<span class="createdby">
		<?php 
        JText::printf('Written by', $this->article->created_by_alias ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author));
        ?>
	</span>
	<?php 
    }
    ?>

	<?php 
    if ($this->params->get('show_create_date')) {
        ?>
	<span class="createdate">
		<?php 
        echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2'));
        ?>
	</span>
	<?php 
示例#22
0
        ?>
		<span class="createdate">
			<?php 
        echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2'));
        ?>
		</span>
	<?php 
    }
    ?>

	<?php 
    if ($this->params->get('show_author') && $this->article->author != "") {
        ?>
		<span class="createby">
			<?php 
        JText::printf($this->article->created_by_alias ? $this->article->created_by_alias : $this->article->author);
        ?>
		</span>
	<?php 
    }
    ?>

	<?php 
    if ($this->params->get('show_section') && $this->article->sectionid || $this->params->get('show_category') && $this->article->catid) {
        ?>
		<?php 
        if ($this->params->get('show_section') && $this->article->sectionid && isset($this->article->section)) {
            ?>
		<span class="article-section">
			<?php 
            if ($this->params->get('link_section')) {
示例#23
0
    }
    ?>

	</h1>
	<?php 
}
?>

	<?php 
if ($this->item->params->get('show_create_date') || $this->item->params->get('show_author') && $this->item->author != "" || $this->item->params->get('show_section') && $this->item->sectionid || $this->item->params->get('show_category') && $this->item->catid) {
    ?>
	<p class="meta">

		<?php 
    if ($this->item->params->get('show_author') && $this->item->author != "") {
        JText::printf('Written by', $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author);
    }
    if ($this->item->params->get('show_create_date')) {
        echo ' ' . JText::_('on') . ' ' . JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3'));
    }
    echo '. ';
    if ($this->item->params->get('show_section') && $this->item->sectionid || $this->item->params->get('show_category') && $this->item->catid) {
        echo JText::_('Posted in ');
        if ($this->item->params->get('show_section') && $this->item->sectionid && isset($this->section->title)) {
            if ($this->item->params->get('link_section')) {
                echo '<a href="' . JRoute::_(ContentHelperRoute::getSectionRoute($this->item->sectionid)) . '">';
            }
            echo $this->section->title;
            if ($this->item->params->get('link_section')) {
                echo '</a>';
            }
示例#24
0
 /**
  * This function to set an module to unpublish
  * 
  * @return: Change value in table of database
  */
 function unassign()
 {
     JSNFactory::localimport('libraries.joomlashine.modules');
     $moduleid = JRequest::getVar('moduleid', array(), 'post', 'array');
     $pages = JRequest::getVar('assignpages', array(), 'post', 'array');
     $unpublish_area = JRequest::getVar('unpublish_area', '');
     $count = count($moduleid);
     if ($count == 0) {
         JText::printf('MSG_AJAX_ERROR', JText::_('MSG_AJAX_MOVE_ERROR'));
         jexit();
     }
     $model = $this->getModel('assignpages');
     switch ($unpublish_area) {
         case 'all':
             for ($i = 0; $i < $count; $i++) {
                 $model->removeAll($moduleid[$i]);
             }
             if ($count == 1) {
                 JText::printf('MSG_AJAX_ASSIGNMENT_MODULE', '"' . JSNModules::getNameOfModule($moduleid) . '"', 'unassigned', 'from', 'All Pages');
             } else {
                 JText::printf('MSG_AJAX_MULTIPLE', $count, ' unassigned to all pages. ');
             }
             break;
         default:
         case 'one':
             for ($i = 0; $i < $count; $i++) {
                 $model->unassignPages($moduleid[$i], $pages);
             }
             if ($count == 1) {
                 JText::printf('MSG_AJAX_ASSIGNMENT_MODULE', '"' . JSNModules::getNameOfModule($moduleid[0]) . '"', 'unassigned', 'from', $model->getPageName($pages[0]));
             } else {
                 JText::printf('MSG_AJAX_MULTIPLE', $count, ' unassigned to this page. ');
             }
             break;
     }
     jexit();
 }