Matthew Hawley

New member
Hello. Could somebody show me how to remove these lines?

atsves.jpg
 
That would be to do with customising the CSS, which isn't something I'm very knowledgeable about, least of all xenForo's CSS, sorry :(
 
No what I mean is, the reason why those lines appear is because of XenForo's CSS rules.

If you install and use the extension Firebug, or use the developer tools in Chrome or IE, you'll see what I mean :)
 
Well, I removed the first line, through a template edit. But can't remove the second line. Do you know which CSS rule it is? Oh and do you like how I customized xFShout? :D Also, how to get the shout time to display like this;

example 6:45

I don't want it like this; 1 moment ago
 
Here is the code:

Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2007-2009 Fillip H. # ||
|| # All Rights Reserved. 											  # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------------------------------------------------------- # ||
|| # You are not allowed to use this on your server unless the files  # ||
|| # you downloaded were done so with permission.					  # ||
|| # ---------------------------------------------------------------- # ||
|| #################################################################### ||
\*======================================================================*/

class DBTech_xFShout_ControllerPublic_Shout extends XenForo_ControllerPublic_Abstract
{
	/** 
	 * View top x stats
	 * @return XenForo_ControllerResponse_View
	 */
	public function actionIndex()
	{    			
		$input = $this->_input->filter(array(
			'instanceid' 	=> XenForo_Input::UINT,
			'chatroomid' 	=> XenForo_Input::UINT,
		));
		
    	// Create some needed arrays
    	$instances 		= $this->_getCacheModel()->get('dbtech_xfshout_instance');
    	$permissions 	= $this->_getCacheModel()->get('dbtech_xfshout_instperms');
    	$visitor 		= XenForo_Visitor::getInstance()->toArray();

    	// Assert whether we are banned
       	$this->_assertBanned($visitor);
		
		// Assert instance id
		$this->_assertInstanceId($input['instanceid']);        	
    	
		// Get effective permissions
		$this->_getShoutModel()->getEffectivePermissions($visitor, $permissions);
		
		// Grab effective permissions
		$effectivePermissions = $visitor['permissions']['dbtech_xfshout'][$input['instanceid']];

		// Assert if we can post shouts
		$this->_assertPermissions($effectivePermissions, 'canview');
		
		// Ensure this is set
		$instance = $instances[$input['instanceid']];
		$instance['options'] = @unserialize($instance['options']);		
		
		// Get all shouts
		$shouts = $this->_getShoutModel()->getShouts($input['instanceid'], $input['chatroomid'], $instance['options']['numshouts']);
		
		foreach ($shouts as &$shout)
		{
			// Parse the dateline properly -.-
			$shout['dateline_parsed'] = XenForo_Locale::dateTime($shout['dateline'], 'relative');
			
			if (preg_match("#^(\/[a-z]*?)\s(.+?)$#i", $shout['message_parsed'], $matches))
			{
				// 2-stage command
				switch ($matches[1])
				{
					case '/me':
						// A slash me
						$shout['message_parsed'] 	= trim($matches[2]);
						$shout['type'] 				= $this->_getShoutModel()->getShoutType('me');
						break;
						
					default:
						//($hook = vBulletinHook::fetch_hook('dbtech_vbshout_parsecommand_2')) ? eval($hook) : false;
						break;				
				}
			}
		}

		//XenForo_Application::get('options')->dbtech_xfshout_limit
		$viewParams = array(
			'shouts'		=> $shouts,
			'sticky'		=> $instance['sticky'],
			'stickyParsed'	=> $instance['sticky_parsed'],
			'instanceid'	=> $input['instanceid'],
			'permissions'	=> $effectivePermissions,
			'visitor'		=> $visitor
		);
		
		return $this->responseView('DBTech_xFShout_ViewPublic_Shout', 'dbtech_xfshout_shouts', $viewParams);
	}
	
	/**
	 * Submits a new shout or returns current shouts
	 * @return XenForo_ControllerResponse_View
	 */
	public function actionAdd()
	{
		$input = $this->_input->filter(array(
			'shout' 		=> XenForo_Input::STRING,
			'shoutid' 		=> XenForo_Input::UINT,
			'instanceid' 	=> XenForo_Input::UINT,
			'chatroomid' 	=> XenForo_Input::UINT,
			'onlyadd'		=> XenForo_Input::UINT,
		));
		
		if (!empty($input['shout']))
		{
			// Actually adding a shout can only come from POST
			$this->_assertPostOnly();
			
	    	// Create some needed arrays
	    	$instances 		= $this->_getCacheModel()->get('dbtech_xfshout_instance');
	    	$permissions 	= $this->_getCacheModel()->get('dbtech_xfshout_instperms');
	    	$visitor 		= XenForo_Visitor::getInstance()->toArray();

	    	// Assert whether we are banned
	       	$this->_assertBanned($visitor);
			
			// Assert instance id
			$this->_assertInstanceId($input['instanceid']);	       	
	    	
			// Get effective permissions
			$this->_getShoutModel()->getEffectivePermissions($visitor, $permissions);
			
			// Grab effective permissions
			$effectivePermissions = $visitor['permissions']['dbtech_xfshout'][$input['instanceid']];		
			
			// Pass the string through various helpers
			$input['shout'] = XenForo_Helper_String::censorString($input['shout']);
			
			// Create the new BBCode Formatter object
			$formatter = XenForo_BbCode_Formatter_Base::create('DBTech_xFShout_BbCode_Shout');
			
			$instance = $instances[$input['instanceid']];
			$instance['options'] = @unserialize($instance['options']);
			$instance['bbcode'] = @unserialize($instance['bbcode']);
			
			$bbcode = array();
			foreach ($instance['bbcode'] as $bbcodeid => $onoff)
			{
				if (!$onoff)
				{
					// Disabled BBCode
					continue;
				}
				
				// Add this to allowed tags
				$bbcode[] = $bbcodeid;
			}
			
			// Override the list of BBCode Tags allowed based on per-instance options
			$formatter->setTags($bbcode);
			
			// Create the BBCode Parser
			$parser = new XenForo_BbCode_Parser($formatter);
			
			// Construct a dummy array to keep the wrapper happy
			$messages = array(0 => array('message' => $input['shout']));
			
			// Do BBCode conversion
			$messages[0]['message'] = XenForo_Helper_String::autoLinkBbCode($messages[0]['message']);
			XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($messages, $parser);			
			
			// Init the datawriter
			$dw = XenForo_DataWriter::create('DBTech_xFShout_DataWriter_Shout');			
				$dw->setOption('effectivePermissions', $effectivePermissions);
				$dw->setErrorHandler(XenForo_DataWriter::ERROR_ARRAY);
							
			if (!$input['shoutid'])
			{
				// Assert if we can post shouts
				$this->_assertPermissions($effectivePermissions, 'canshout');
				
				// Set some new-only values
				$dw->set('userid', XenForo_Visitor::getUserId());
				$dw->set('instanceid', $input['instanceid']);
				$dw->set('chatroomid', $input['chatroomid']);
			}
			else
			{
				// We're potentially editing a shout
				$dw->setExistingData($input['shoutid']);
				
				if ($dw->get('userid') == $visitor['user_id'])
				{
					// Assert if we can edit own shouts
					$this->_assertPermissions($effectivePermissions, 'caneditown');
				}
				else
				{
					// Assert if we can post shouts
					$this->_assertPermissions($effectivePermissions, 'caneditothers');
				}
			}
			
			// Set the rest of the (always changed) data
				$dw->set('message', strip_tags($input['shout']));
				$dw->set('message_parsed', strip_tags($messages[0]['messageHtml']->__toString()));
			$shoutid = $dw->save();
			
			if (!$shoutid)
			{
				// Fling me sum error
				throw $this->responseException(
					$this->responseError(implode('<br />', $dw->getErrors()), 500)
				);				
			}
		}
		
		return ($input['onlyadd'] ? true : $this->actionIndex());
	}
	
	/**
	 * Deletes a shout.
	 * @return XenForo_ControllerResponse_View
	 */
	public function actionDelete()
	{
		$input = $this->_input->filter(array(
			'shoutid' 		=> XenForo_Input::UINT,
			'instanceid' 	=> XenForo_Input::UINT,
			'chatroomid' 	=> XenForo_Input::UINT,
			'onlydelete'	=> XenForo_Input::UINT,
		));
		
		// Actually adding a shout can only come from POST
		$this->_assertPostOnly();
		
    	// Create some needed arrays
    	$instances 		= $this->_getCacheModel()->get('dbtech_xfshout_instance');
    	$permissions 	= $this->_getCacheModel()->get('dbtech_xfshout_instperms');
    	$visitor 		= XenForo_Visitor::getInstance()->toArray();

    	// Assert whether we are banned
       	$this->_assertBanned($visitor);
		
		// Assert instance id
		$this->_assertInstanceId($input['instanceid']);	       	
    	
		// Get effective permissions
		$this->_getShoutModel()->getEffectivePermissions($visitor, $permissions);
		
		// Grab effective permissions
		$effectivePermissions = $visitor['permissions']['dbtech_xfshout'][$input['instanceid']];
		
		// Init the datawriter
		$dw = XenForo_DataWriter::create('DBTech_xFShout_DataWriter_Shout');			
			$dw->setOption('effectivePermissions', $effectivePermissions);
			$dw->setErrorHandler(XenForo_DataWriter::ERROR_ARRAY);
			$dw->setExistingData($input['shoutid']);
			
			if ($dw->get('userid') == $visitor['user_id'])
			{
				// Assert if we can edit own shouts
				$this->_assertPermissions($effectivePermissions, 'caneditown');
			}
			else
			{
				// Assert if we can post shouts
				$this->_assertPermissions($effectivePermissions, 'caneditothers');
			}
		$dw->delete();
		
		return ($input['onlydelete'] ? true : $this->actionIndex());
	}	
	
	/**
	 * Helper to assert that this action is available with a valid instance id. 
	 * Throws an exception if the request doesn't carry an instance id or it's invalid
	 * 
	 * @param integer The instance ID to check.
	 */
	protected function _assertInstanceId($instance_id)
	{
		$instances = $this->_getCacheModel()->get('dbtech_xfshout_instance');
		if (!isset($instances[$instance_id]))
		{
			throw $this->responseException(
				$this->responseError(new XenForo_Phrase('dbtech_xfshout_invalid_instanceid'), 500)
			);
		}
	}
	
	/**
	 * Helper to assert that this action is unavailable if banned. 
	 * Throws an exception if the user is banned
	 * 
	 * @param integer The visitor to check.
	 */
	protected function _assertBanned($visitor)
	{
		if ($visitor['dbtech_xfshout_banned'])
		{
			throw $this->responseException(
				$this->responseError(new XenForo_Phrase('dbtech_xfshout_banned'), 500)
			);
		}
	}

	/**
	 * Helper to assert that this action is available with a valid permission. 
	 * Throws an exception if the visitor doesn't have the required permissions.
	 * 
	 * @param array The visitor's permissions
	 * @param string The type of action we're doing
	 */
	protected function _assertPermissions($permissions, $type)
	{
		if (!$permissions[$type])
		{
			throw $this->responseException(
				$this->responseError(new XenForo_Phrase('dbtech_xfshout_no_permissions_' . $type), 500)
			);
		}
	}	

	/**
	 * Grabs the xFShout model from the cache.
	 * 
	 * @return DBTech_xFShout_Model_Shout
	 */
	protected function _getShoutModel()
	{
		return $this->getModelFromCache('DBTech_xFShout_Model_Shout');
	}
	/**
	 * Grabs the Cache model from the cache.
	 * 
	 * @return XenForo_Model_DataRegistry
	 */
	protected function _getCacheModel()
	{
		return $this->getModelFromCache('XenForo_Model_DataRegistry');
	}
}
 
Last edited:
PHP:
$shout['dateline_parsed'] = XenForo_Locale::dateTime($shout['dateline'], 'relative');
is the line.
 
Now, that you've started doing xenforo add-ons are you going to add vbshout's feature's to xfshout, and add a xfshout support forum?

It's on the long term plan, but not in the schedule for the next month or so. We won't know exactly what the roadmap is regarding XenForo until we have some solid sales figures from our first 2 XF mods in 4 weeks or so.
 
It's on the long term plan, but not in the schedule for the next month or so. We won't know exactly what the roadmap is regarding XenForo until we have some solid sales figures from our first 2 XF mods in 4 weeks or so.

I don't really like that outlook....

Considering xFShout would do much better in the long term, TaigaChat has been downloaded 250+ times as it is right now. The Avatar and Sig mods could be good features to have, but I think overall, you could have gained a better view with the sales from xFShout. Currently, I have seen 20 different replies about getting shoutbox commands in the other shoutbox, and it isn't happening. There is not control on editing shouts, pruning, PMing, nothing....

I have heavily modified the original xfShout code to get it to look halfway like we would want it, the only thing I am stuck on is a BBCode Toolbar...

eIpdMF.png


That is what is done so far.... I just really think you guys would get a better view of what could be done, using one of your most popular products....
 

Attachments

  • eIpdMF.png
    eIpdMF.png
    32.7 KB · Views: 7
I use Taiga chat as well and my members tolerate it, because it's all there is. None of them LIKE it. The primary reason I don't use xfShout is that I *HATE* having latest chats at the top. So, I'd like to see xFShout get like a week of coding love done on it myself. I think most issues could be corrected and whatnot to make people choose it over TaigaChat, after that, once you do a pro version, you've already got people ready to pay that are using the lite version.

After that, I'd like to see xFCredits, xFArcade and well.. many other DBT mods. Hopefully we'll get 'em! :D
 
I don't really like that outlook....

Considering xFShout would do much better in the long term, TaigaChat has been downloaded 250+ times as it is right now. The Avatar and Sig mods could be good features to have, but I think overall, you could have gained a better view with the sales from xFShout. Currently, I have seen 20 different replies about getting shoutbox commands in the other shoutbox, and it isn't happening. There is not control on editing shouts, pruning, PMing, nothing....

I have heavily modified the original xfShout code to get it to look halfway like we would want it, the only thing I am stuck on is a BBCode Toolbar...

eIpdMF.png


That is what is done so far.... I just really think you guys would get a better view of what could be done, using one of your most popular products....

We deliberately picked our latest two vBulletin mods so we could closely compare the sales rates between the two.

The decision won't be based on total numbers, it'd be based on comparing the ROI of the xF version versus the vB version in terms of how much extra time it takes to port to xF vs how much money it makes.

Porting such an old and well established vB mod would have made an accurate comparison more or less impossible.

As you say the avatars/signature mod won't be as popular as something like a shoutbox, but that still holds true for vBulletin as well, so it should more or less even itself out.

;) Don't worry, we're not amateurs.

Cosmic
 
We deliberately picked our latest two vBulletin mods so we could closely compare the sales rates between the two.

The decision won't be based on total numbers, it'd be based on comparing the ROI of the xF version versus the vB version in terms of how much extra time it takes to port to xF vs how much money it makes.

Porting such an old and well established vB mod would have made an accurate comparison more or less impossible.

As you say the avatars/signature mod won't be as popular as something like a shoutbox, but that still holds true for vBulletin as well, so it should more or less even itself out.

;) Don't worry, we're not amateurs.

Cosmic

Not sure what you mean with the last comment, but anywho....

With the base that you have for xFShout 1.0, it seems strange that it is being left behind for the time, all things considering. The version uploaded to xF is very good, and many people want to use it, if there were just a couple lines of code removed or changed.

Fetching Shouts in ......

The main reason people stopped d/loading xFShout was because support was dropped, that is the only reason. You have a great customer base here, many who have your vB products ( I purchased quite a few for vB myself) already, and have a xF license they want to use as well....

My post certainly wasn't downplaying if you were an amateur or not, nor any disrespect to the coders or members who worked on the add-ons. Just simply trying to understand the decision to go ahead with those, instead of working on one you already have a great start on for a Lite version.... That was it. I won't ask again, my apologies.
 
Not sure what you mean with the last comment, but anywho....

With the base that you have for xFShout 1.0, it seems strange that it is being left behind for the time, all things considering. The version uploaded to xF is very good, and many people want to use it, if there were just a couple lines of code removed or changed.

Fetching Shouts in ......

The main reason people stopped d/loading xFShout was because support was dropped, that is the only reason. You have a great customer base here, many who have your vB products ( I purchased quite a few for vB myself) already, and have a xF license they want to use as well....

My post certainly wasn't downplaying if you were an amateur or not, nor any disrespect to the coders or members who worked on the add-ons. Just simply trying to understand the decision to go ahead with those, instead of working on one you already have a great start on for a Lite version.... That was it. I won't ask again, my apologies.

The base for xF shout is very different to the vB version, and where possible we will be trying to make the two versions identical with the same features, so it would be re-written from scratch when it gets ported over. With that in mind it doesn't make too much sense for us to work on this version, just to scrap it later for another.

The we're not amateurs comment was just letting you know that you don't need to worry about us making such simple oversights like not realising avatars/signatures wouldn't sell as well as our shoutbox :p Generally when people say they don't like our outlook and think we should have done something else instead, it gives the impression they think we're making a mistake and don't know what we're doing, was just letting you know that's not the case ^.^

Apologies if it came across as anything other than a cheeky nudge and wink, I had hoped the smiley would make it clear it was meant in a friendly way :p

For the record you can, of course, feel free to ask again - we're always happy to explain why we made certain decisions or didn't make others, we welcome questions and feedback.

Cosmic
 
We deliberately picked our latest two vBulletin mods so we could closely compare the sales rates between the two.

The decision won't be based on total numbers, it'd be based on comparing the ROI of the xF version versus the vB version in terms of how much extra time it takes to port to xF vs how much money it makes.

Porting such an old and well established vB mod would have made an accurate comparison more or less impossible.

As you say the avatars/signature mod won't be as popular as something like a shoutbox, but that still holds true for vBulletin as well, so it should more or less even itself out.

;) Don't worry, we're not amateurs.

Cosmic

Ohh!!! That is sooo cool! Can I beta test it? :D
 
Well, I removed the first line, through a template edit. But can't remove the second line. Do you know which CSS rule it is? Oh and do you like how I customized xFShout? :D Also, how to get the shout time to display like this;

example 6:45

I don't want it like this; 1 moment ago

Maybe this is late, but I think it is usefull for other people who are searching for this. I worked my ass of to find a little change to make it like you want. Change the code Fillip H. said:
Code:
$shout['dateline_parsed'] = XenForo_Locale::[COLOR="#FF0000"]dateTime[/COLOR]($shout['dateline'], '[COLOR="#FF0000"]relative[/COLOR]');

With the following:
Code:
$shout['dateline_parsed'] = XenForo_Locale::[COLOR="#FF0000"]time[/COLOR]($shout['dateline'], '[COLOR="#FF0000"]absolute[/COLOR]');
 
Back
Top