Hi there,
Bob, I really need help some coding help. I don't want support from other author because they don't care this.
I have an advanced statistics (latest posts, new threads, etc.) add-on. I'm just trying to add Latest Updated Showcase Items on tabs.
I will just add what I added codes here.
1- library/Addon/ModernStatistic/ControllerAdmin/ModernStatistic.php
Find...
Add below (similar codes, just changes them all with Showcase) :
Find...
Add below...
Find...
Replace with...
Find...
Replace with...
Find...
Replace with...
Product model...
Save and now add this file here: library/Addon/ModernStatistic/Model/Showcase.php
This not working and getting following error:
An exception occurred: Call to undefined method Addon_ModernStatistic_Model_ModernStatistic::checkNFLJ_ShowcaseAddon() in /home/site/domains/site/public_html/library/Addon/ModernStatistic/ControllerAdmin/ModernStatistic.php on line 139
It's possible to develop this add-on for me? I really need these feature...
Bob, I really need help some coding help. I don't want support from other author because they don't care this.
I have an advanced statistics (latest posts, new threads, etc.) add-on. I'm just trying to add Latest Updated Showcase Items on tabs.
I will just add what I added codes here.
1- library/Addon/ModernStatistic/ControllerAdmin/ModernStatistic.php
Find...
Code:
$resourceVersion = $modernStatisticModel->checkXenForoResourceAddon();
$categoryOptions = array();
$resourcePrefixes = array();
if($resourceVersion)
{
$listTypeUsers[] = array('value' => 'user_most_resources', 'label' => new XenForo_Phrase('most_resources'));
$listKinds[] = array('value' => 'resource', 'label' => new XenForo_Phrase('resource'));
$categoryModel = $this->getModelFromCache('XenResource_Model_Category');
$categories = $categoryModel->prepareCategories($categoryModel->getViewableCategories());
foreach ($categories AS $categoryId => $category)
{
$category['depth'] += 1;
$categoryOptions[$categoryId] = array(
'value' => $categoryId,
'label' => $category['category_title'],
'depth' => $category['depth']
);
}
$resourcePrefixModel = $this->_getResourcePrefixModel();
$resourcePrefixes = $resourcePrefixModel->getPrefixOptions();
}
Add below (similar codes, just changes them all with Showcase) :
Code:
$showcaseVersion = $modernStatisticModel->checkNFLJ_ShowcaseAddon();
$categoryOptions = array();
$showcasePrefixes = array();
if($showcaseVersion)
{
$listTypeUsers[] = array('value' => 'user_most_showcase_item', 'label' => new XenForo_Phrase('showcase'));
$listKinds[] = array('value' => 'showcase', 'label' => new XenForo_Phrase('showcase'));
$categoryModel = $this->getModelFromCache('NFLJ_Showcase_Model_Category');
$categories = $categoryModel->prepareCategories($categoryModel->getViewableCategories());
foreach ($categories AS $categoryId => $category)
{
$category['depth'] += 1;
$categoryOptions[$categoryId] = array(
'value' => $categoryId,
'label' => $category['category_title'],
'depth' => $category['depth']
);
}
$showcasePrefixModel = $this->_getShowcasePrefixModel();
$showcasePrefixes = $showcasePrefixModel->getPrefixOptions();
}
Find...
Code:
$listTypeResources = array(
array('value' => 'resource_last_update', 'label' => new XenForo_Phrase('latest_updates')),
array('value' => 'resource_resource_date', 'label' => new XenForo_Phrase('newest_resources')),
array('value' => 'resource_rating_weighted', 'label' => new XenForo_Phrase('top_resources')),
array('value' => 'resource_download_count', 'label' => new XenForo_Phrase('most_downloaded')),
);
Add below...
Code:
$listTypeShowcase = array(
array('value' => 'showcase_last_update', 'label' => new XenForo_Phrase('showcase_latest_updates')),
);
Find...
Code:
$defaultTabData = array(
'kind' => '',
'title' => '',
'type' => '',
'order_type' => '',
'order_direction' => '',
'cut_off' => 0,
'prefix_id' => array(),
'forums' => array(),
'discussion_state' => array(),
'discussion_open' => array(),
'categories' => array(),
'user_groups' => array(),
'resource_prefix_id' => array(),
'resource_state' => array(),
'gender' => array(),
'user_state' => array(),
'currency_id' => 0,
'display_order' => $lastOrder,
);
Replace with...
Code:
$defaultTabData = array(
'kind' => '',
'title' => '',
'type' => '',
'order_type' => '',
'order_direction' => '',
'cut_off' => 0,
'prefix_id' => array(),
'forums' => array(),
'discussion_state' => array(),
'discussion_open' => array(),
'categories' => array(),
'user_groups' => array(),
'resource_prefix_id' => array(),
'resource_state' => array(),
'showcase_state' => array(),
'showcase_prefix_id' => array(),
'gender' => array(),
'user_state' => array(),
'currency_id' => 0,
'display_order' => $lastOrder,
);
Find...
Code:
$viewParams = array(
'modernStatistic' => $modernStatistic,
'lastOrder' => $lastOrder,
'styles' => $styles,
'defaultTabData' => $defaultTabData,
'resourceVersion' => $resourceVersion,
'userGroupOptions' => $userGroupOptions,
'categoryList' => $categoryOptions,
'resourcePrefixes' => $resourcePrefixes,
'currencyOptions' => $currencyOptions,
'forumList' => $forumOptions,
'nodeList' => $nodeList,
'prefixes' => $this->getModelFromCache('XenForo_Model_ThreadPrefix')->getPrefixOptions(),
'nextCounter' => count($tabsData),
'tabsData' => $tabsData,
'itemLimit' => $itemLimit,
'listTypeThreads' => $listTypeThreads,
'listTypeResources' => $listTypeResources,
'listTypeUsers' => $listTypeUsers,
'listThreadOrders' => $listThreadOrders,
'languages' => $this->getModelFromCache('XenForo_Model_Language')->getLanguagesForOptionsTag(),
'listKinds' => $listKinds,
);
Replace with...
Code:
$viewParams = array(
'modernStatistic' => $modernStatistic,
'lastOrder' => $lastOrder,
'styles' => $styles,
'defaultTabData' => $defaultTabData,
'resourceVersion' => $resourceVersion,
'userGroupOptions' => $userGroupOptions,
'showcaseVersion' => $showcaseVersion,
'categoryList' => $categoryOptions,
'resourcePrefixes' => $resourcePrefixes,
'showcasePrefixes' => $showcasePrefixes,
'currencyOptions' => $currencyOptions,
'forumList' => $forumOptions,
'nodeList' => $nodeList,
'prefixes' => $this->getModelFromCache('XenForo_Model_ThreadPrefix')->getPrefixOptions(),
'nextCounter' => count($tabsData),
'tabsData' => $tabsData,
'itemLimit' => $itemLimit,
'listTypeThreads' => $listTypeThreads,
'listTypeResources' => $listTypeResources,
'listTypeShowcase' => $listTypeShowcase,
'listTypeUsers' => $listTypeUsers,
'listThreadOrders' => $listThreadOrders,
'languages' => $this->getModelFromCache('XenForo_Model_Language')->getLanguagesForOptionsTag(),
'listKinds' => $listKinds,
);
Find...
Code:
$writerData = $this->_input->filter(array(
'title' => XenForo_Input::STRING,
'active' => XenForo_Input::UINT,
'usename_marke_up' => XenForo_Input::UINT,
'show_thread_prefix' => XenForo_Input::UINT,
'show_resource_prefix' => XenForo_Input::UINT,
'show_showcase_prefix' => XenForo_Input::UINT,
'load_fisrt_tab' => XenForo_Input::UINT,
'control_position' => XenForo_Input::STRING,
'preview_tooltip' => XenForo_Input::STRING,
'position' => XenForo_Input::STRING,
'style_display' => XenForo_Input::STRING,
'thread_cutoff' => XenForo_Input::UINT,
'enable_cache' => XenForo_Input::UINT,
'cache_time' => XenForo_Input::UINT,
'auto_update' => XenForo_Input::UINT,
'allow_change_layout' => XenForo_Input::UINT,
'allow_manual_refresh' => XenForo_Input::UINT,
'allow_user_setting' => XenForo_Input::UINT,
'modern_criteria' => XenForo_Input::ARRAY_SIMPLE,
'style_settings' => XenForo_Input::ARRAY_SIMPLE,
));
Replace with...
Code:
$writerData = $this->_input->filter(array(
'title' => XenForo_Input::STRING,
'active' => XenForo_Input::UINT,
'usename_marke_up' => XenForo_Input::UINT,
'show_thread_prefix' => XenForo_Input::UINT,
'show_resource_prefix' => XenForo_Input::UINT,
'load_fisrt_tab' => XenForo_Input::UINT,
'control_position' => XenForo_Input::STRING,
'preview_tooltip' => XenForo_Input::STRING,
'position' => XenForo_Input::STRING,
'style_display' => XenForo_Input::STRING,
'thread_cutoff' => XenForo_Input::UINT,
'enable_cache' => XenForo_Input::UINT,
'cache_time' => XenForo_Input::UINT,
'auto_update' => XenForo_Input::UINT,
'allow_change_layout' => XenForo_Input::UINT,
'allow_manual_refresh' => XenForo_Input::UINT,
'allow_user_setting' => XenForo_Input::UINT,
'modern_criteria' => XenForo_Input::ARRAY_SIMPLE,
'style_settings' => XenForo_Input::ARRAY_SIMPLE,
));
Product model...
Code:
protected function _getNFLJ_ShowcasePrefixModel()
{
return $this->getModelFromCache('NFLJ_Showcase_Model_Prefix');
}
Save and now add this file here: library/Addon/ModernStatistic/Model/Showcase.php
PHP:
<?php
class Addon_ModernStatistic_Model_Showcase extends XFCP_Addon_ModernStatistic_Model_Showcase
{
public function prepareResourceConditions(array $conditions, array &$fetchOptions)
{
$result = parent::prepareResourceConditions($conditions, $fetchOptions);
$sqlConditions = array($result);
$db = $this->_getDb();
if (!empty($conditions['item_state']))
{
if (is_array($conditions['item_state']))
{
$sqlConditions[] = 'item.item_state IN (' . $db->quote($conditions['item_state']) . ')';
}
else
{
$sqlConditions[] = 'item.item_state = ' . $db->quote($conditions['item_state']);
}
}
if (count($sqlConditions) > 1) {
return $this->getConditionsForClause($sqlConditions);
} else {
return $result;
}
}
}
This not working and getting following error:
An exception occurred: Call to undefined method Addon_ModernStatistic_Model_ModernStatistic::checkNFLJ_ShowcaseAddon() in /home/site/domains/site/public_html/library/Addon/ModernStatistic/ControllerAdmin/ModernStatistic.php on line 139
- Addon_ModernStatistic_ControllerAdmin_ModernStatistic->actionEdit() in XenForo/FrontController.php at line 351
- XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
- XenForo_FrontController->run() in /home/site/domains/site/public_html/admin.php at line 13
It's possible to develop this add-on for me? I really need these feature...