Skip to content

Commit

Permalink
EasyBlog latest version support added and release 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsbd71 committed Jul 15, 2019
1 parent bb40aa2 commit fd898db
Show file tree
Hide file tree
Showing 12 changed files with 233 additions and 99 deletions.
Empty file modified assets/css/image-picker.css
100755 → 100644
Empty file.
Empty file modified assets/js/image-picker.min.js
100755 → 100644
Empty file.
72 changes: 64 additions & 8 deletions fields/ezbcategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@

// no direct access
defined( '_JEXEC' ) or die('Restricted access');
jimport('joomla.html.html');
jimport('joomla.form.formfield');


if(
file_exists( JPATH_SITE . '/components/com_easyblog/easyblog.php' )
and
file_exists( JPATH_ROOT . '/components/com_easyblog/constants.php' )
)
if( file_exists( JPATH_ROOT . '/components/com_easyblog/constants.php' ) )
{
jimport('joomla.html.html');
jimport('joomla.form.formfield');

class JFormFieldEZBCategories extends JFormField
{
Expand Down Expand Up @@ -88,3 +83,64 @@ protected function getInput()
}
}
}
else
{class JFormFieldEZBCategories extends JFormField
{

protected $type = 'EZBCategories';

protected function getInput()
{
$file = JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
if (!JFile::exists($file)) {
return;
}
require_once($file);

$mainframe = JFactory::getApplication();
$doc = JFactory::getDocument();

$options = array();
$attr = '';
$categoryList = array();

// Initialize some field attributes.
$attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : 'class="inputbox chzn-select"';

// To avoid user's confusion, readonly="true" should imply disabled="true".
if ( (string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
$attr .= ' disabled="disabled"';
}

$attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
$attr .= $this->multiple ? ' multiple="multiple"' : '';

// Initialize JavaScript field attributes.
$attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
$attr .= 'multiple="multiple"';
$attr .= 'style="width:280px;"';
$attr .= 'data-placeholder="Click here to select categories"';

require_once( JPATH_ROOT . '/administrator/components/com_easyblog/models/categories.php' );
$model = EB::model('Category');
// Retrieve parent categories
$categories = $model->getCategories('latest', false, 0, '', false);
if(count($categories) > 0)
{
$optgroup = JHTML::_('select.optgroup','Select category','id','title');
array_push($categoryList,$optgroup);

foreach ($categories as $row) {
$opt = new stdClass();
$opt->id = $row->id;
$opt->title = $row->title;

array_push($categoryList,$opt);
}
}

$html = JHTML::_('select.genericlist', $categoryList, $this->name, trim($attr), 'id', 'title', $this->value );
return $html;
}
}
}
6 changes: 3 additions & 3 deletions lib_xef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<description>
ThemeXpert Extension Framework (XEF) – A rapid extension development framework for all ThemeXpert extensions.
</description>
<creationDate>03/16/2014</creationDate>
<creationDate>15/07/2019</creationDate>
<author>Parvez Akther</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://themexpert.com/</authorUrl>
<copyright>Copyright (C) 2011 - 2011 ThemeXpert</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license>
<version>1.6.0</version>
<version>1.7.0</version>

<files>
<folder>assets</folder>
Expand All @@ -26,4 +26,4 @@
<file>utility.php</file>
</files>

</extension>
</extension>
243 changes: 158 additions & 85 deletions sources/easyblog/easyblog.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,125 +7,198 @@

// Protect from unauthorized access
defined('_JEXEC') or die();
jimport('joomla.system.file');
jimport('joomla.system.folder');

// Require XEF helper class
require_once JPATH_LIBRARIES . '/xef/xef.php';

// Load Easyblog helper and router class
require_once JPATH_SITE . '/components/com_easyblog/helpers/helper.php';
require_once JPATH_SITE . '/components/com_easyblog/helpers/date.php';
require_once JPATH_SITE . '/administrator/components/com_easyblog/tables/profile.php';

class XEFSourceEasyblog extends XEFHelper
if( file_exists( JPATH_ROOT . '/components/com_easyblog/constants.php' ) )
{
public function getItems()
// Load Easyblog helper and router class
require_once JPATH_SITE . '/components/com_easyblog/helpers/helper.php';
require_once JPATH_SITE . '/components/com_easyblog/helpers/date.php';
require_once JPATH_SITE . '/administrator/components/com_easyblog/tables/profile.php';

class XEFSourceEasyblog extends XEFHelper
{
$catid = ($this->get('ezb_catfilter')) ? $this->get('ezb_catid',NULL) : '';
$ordering = $this->get('ezb_ordering','latest');
$user = JFactory::getUser();
$category = EasyBlogHelper::getTable( 'Category', 'Table' );
public function getItems()
{
$catid = ($this->get('ezb_catfilter')) ? $this->get('ezb_catid',NULL) : '';
$ordering = $this->get('ezb_ordering','latest');
$user = JFactory::getUser();
$category = EasyBlogHelper::getTable( 'Category', 'Table' );

$category->load($catid);

if($category->private && $user->id == 0){
echo JText::_('This category is set to private');
return;
}

if( !class_exists( 'EasyBlogModelBlog' ) ){
jimport( 'joomla.application.component.model' );
JLoader::import( 'blog' , EBLOG_ROOT . '/' . 'models' );
}

$category->load($catid);
$model = EasyBlogHelper::getModel( 'Blog' );

if($category->private && $user->id == 0){
echo JText::_('This category is set to private');
return;
if( $this->get( 'ezfeatured') )
{
$items = $model->getFeaturedBlog( $catid , $this->get('count') );
}
else
{
$items = $model->getBlogsBy('category', $catid, $ordering , $this->get('count') , EBLOG_FILTER_PUBLISHED, null, false );
}

$config = EasyBlogHelper::getConfig();

if(! empty($items)){
for($i = 0; $i < count($items); $i++)
{
$data =& $items[$i];
$row = EasyBlogHelper::getTable( 'Blog', 'Table' );
$row->bind( $data );

//$row =& $items[$i];
$author = EasyBlogHelper::getTable( 'Profile', 'Table' );

$row->author = $author->load( $row->created_by );
$row->commentCount = EasyBlogHelper::getCommentCount($row->id);


$requireVerification = false;
if($config->get('main_password_protect', true) && !empty($row->blogpassword))
{
$row->title = JText::sprintf('COM_EASYBLOG_PASSWORD_PROTECTED_BLOG_TITLE', $row->title);
$requireVerification = true;
}

if($requireVerification && !EasyBlogHelper::verifyBlogPassword($row->blogpassword, $row->id))
{
$theme = new CodeThemes();
$theme->set('id', $row->id);
$theme->set('return', base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id)));
$row->introtext = $theme->fetch( 'blog.protected.php' );
$row->content = $row->introtext;
$row->showRating = false;
$row->protect = true;
}
else
{
$row->introtext = EasyBlogHelper::getHelper( 'Videos' )->strip( $row->content );
$row->showRating = true;
$row->protect = false;

}
}//end foreach
}

// XEFUtility::debug($items);
$items = $this->prepareItems($items);

return $items;
}

if( !class_exists( 'EasyBlogModelBlog' ) ){
jimport( 'joomla.application.component.model' );
JLoader::import( 'blog' , EBLOG_ROOT . '/' . 'models' );
public function getLink($item)
{
return EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $item->id . $this->getMenuItemId() );
}

$model = EasyBlogHelper::getModel( 'Blog' );
public function getCategory($item)
{
return $item->category;
}

if( $this->get( 'ezfeatured') )
public function getCategoryLink($item)
{
$items = $model->getFeaturedBlog( $catid , $this->get('count') );
return EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id='.$item->category_id . $this->getMenuItemId());
}
else

public function getImage($item)
{
$items = $model->getBlogsBy('category', $catid, $ordering , $this->get('count') , EBLOG_FILTER_PUBLISHED, null, false );
if( isset($item->image) AND ($item->image != null) )
{
$image = json_decode($item->image);
return $image->url;
}
return ( $item->intro ) ? XEFUtility::getImage($item->intro) : XEFUtility::getImage($item->content);
}

$config = EasyBlogHelper::getConfig();
public function getDate($item)
{
$config = EasyBlogHelper::getConfig();

if(! empty($items)){
for($i = 0; $i < count($items); $i++)
{
$data =& $items[$i];
$row = EasyBlogHelper::getTable( 'Blog', 'Table' );
$row->bind( $data );
return EasyBlogDateHelper::toFormat( JFactory::getDate( $item->created ), $config->get('layout_dateformat', '%A, %d %B %Y') );
}
}
}
else
{
// Load Easyblog helper and router class
require_once JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
class XEFSourceEasyblog extends XEFHelper
{
public function getItems()
{
$catid = ($this->get('ezb_catfilter')) ? $this->get('ezb_catid',NULL) : '';
$ordering = $this->get('ezb_ordering','latest');
$user = JFactory::getUser();

//$row =& $items[$i];
$author = EasyBlogHelper::getTable( 'Profile', 'Table' );
$model = EB::model('Blog');
$items = $model->getBlogsBy('category', $catid, $ordering, $this->get('count'), EBLOG_FILTER_PUBLISHED, null, $respectFrontpage = true, $excludeBlog = false, false, false, true, array(), array(), null, 'listlength', true, array(), array(), $excludeFeatured = $this->get( 'ezfeatured'), array(), array('paginationType' => 'none'));

$row->author = $author->load( $row->created_by );
$row->commentCount = EasyBlogHelper::getCommentCount($row->id);

$config = EasyBlogHelper::getConfig();

$requireVerification = false;
if($config->get('main_password_protect', true) && !empty($row->blogpassword))
if(! empty($items)){
for($i = 0; $i < count($items); $i++)
{
$row->title = JText::sprintf('COM_EASYBLOG_PASSWORD_PROTECTED_BLOG_TITLE', $row->title);
$requireVerification = true;
}
$data =& $items[$i];
$data->introtext = $data->intro;

}//end foreach
}

if($requireVerification && !EasyBlogHelper::verifyBlogPassword($row->blogpassword, $row->id))
{
$theme = new CodeThemes();
$theme->set('id', $row->id);
$theme->set('return', base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id)));
$row->introtext = $theme->fetch( 'blog.protected.php' );
$row->content = $row->introtext;
$row->showRating = false;
$row->protect = true;
}
else
{
$row->introtext = EasyBlogHelper::getHelper( 'Videos' )->strip( $row->content );
$row->showRating = true;
$row->protect = false;
$items = $this->prepareItems($items);

}
}//end foreach
return $items;
}

// XEFUtility::debug($items);
$items = $this->prepareItems($items);

return $items;
}
public function getLink($item)
{
return EBR::_('index.php?option=com_easyblog&view=entry&id=' . $item->id . $this->getMenuItemId() );
}

public function getLink($item)
{
return EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $item->id . $this->getMenuItemId() );
}
public function getCategory($item)
{
// Load up the category table
$category = EB::table('Category');
$category->load($item->category_id);

public function getCategory($item)
{
return $item->category;
}
return $item->category_title = $category->title;
}

public function getCategoryLink($item)
{
return EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id='.$item->category_id . $this->getMenuItemId());
}
public function getCategoryLink($item)
{
return EBR::_('index.php?option=com_easyblog&view=categories&layout=listings&id='.$item->category_id . $this->getMenuItemId());
}

public function getImage($item)
{
if( isset($item->image) AND ($item->image != null) )
public function getImage($item)
{
$image = json_decode($item->image);
return $image->url;
if( isset($item->image) AND ($item->image != null) )
{
$image = json_decode($item->image);
return $image->url;
}
return ( $item->intro ) ? XEFUtility::getImage($item->intro) : XEFUtility::getImage($item->content);
}
return ( $item->intro ) ? XEFUtility::getImage($item->intro) : XEFUtility::getImage($item->content);
}

public function getDate($item)
{
$config = EasyBlogHelper::getConfig();
public function getDate($item)
{

return EasyBlogDateHelper::toFormat( JFactory::getDate( $item->created ), $config->get('layout_dateformat', '%A, %d %B %Y') );
return JFactory::getDate( $item->created );
}
}
}
}
Empty file modified sources/flickr/api/LICENSE
100755 → 100644
Empty file.
Empty file modified sources/flickr/api/README.md
100755 → 100644
Empty file.
Empty file modified sources/flickr/api/auth.php
100755 → 100644
Empty file.
Empty file modified sources/flickr/api/example.php
100755 → 100644
Empty file.
Empty file modified sources/flickr/api/getToken.php
100755 → 100644
Empty file.
Empty file modified sources/flickr/api/phpFlickr.php
100755 → 100644
Empty file.
Loading

0 comments on commit fd898db

Please sign in to comment.