• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[bd] Widget Framework

Status
Not open for further replies.
I'm having problems creating own widgets!

1. i've created my file
PHP:
<?php
class WidgetFramework_WidgetRenderer_Addons extends WidgetFramework_WidgetRenderer_Threads {

    protected function _getConfiguration() {
		return array(
			'name' => 'Addons',
			'options' => array(
				'type' => XenForo_Input::STRING,
				'cutoff' => XenForo_Input::UINT,
				'limit' => XenForo_Input::UINT,
			),
			'useCache' => true,
			'useWrapper' => false,
		);
	}

        protected function _render(array $widget, $templateName, array $params, XenForo_Template_Abstract $renderTemplateObject) {
		$threadModel = XenForo_Model::create('XenForo_Model_Thread');
		$nodeModel = XenForo_Model::create('XenForo_Model_Node');

		$new = $threadModel->getThreads(
				array(
					'forum_ids' => $forumId = XenForo_Application::get('options')->ragtek_AddonForumId,
				)
				,array(
					'order' => 'post_date',
					'orderDirection' => 'desc',
					'join' => XenForo_Model_Thread::FETCH_AVATAR,
					// 'readUserId' => XenForo_Visitor::getUserId(),
					// 'includeForumReadDate' => true,
					'limit' => $widget['options']['limit'],
				)
			);

		$renderTemplateObject->setParam('new', $new);
		$renderTemplateObject->setParam('useTabs', $tabs > 0);

		return $renderTemplateObject->render();
	}
}
2. i'm injecting
PHP:
$renderers[] = 'WidgetFramework_WidgetRenderer_Addons';
at event "widget_framework_ready"

It seems that it's working, because i can create a new add-on widget, when i save it, i don't get an error message, it shows "widget saved successfully" but i can't see it on the widget list and it's also not saved in the xf_widget table.

ok i've found the problem

The message "widget saved successfully" is shown always, even if there's a error!
If i save & exit, i see the error, if i only save it, i see the successfully message, event there was a problem;)


There's a small template bug
it should be "delete widget" and not delete template;)
 

Attachments

  • deltemplate.webp
    deltemplate.webp
    15.5 KB · Views: 24
holly **** this is really a nice one!!!!wow

I have only two suggestion: use phrases for widget titles and the positioning (conditionals & display order) could be more userfriendly^^ (drag & drop and

could be "hard" for the avarage users here;)
)
Hence it's called "Advanced" :D

There's an issue with the lastest thread tabs when using a dark style

View attachment 10198
Does it work correctly in the default style? Which style is this, exactly?

Are you sure that this works?

ATM i have 30 queries on the index page
when i deactive the addon => 25 queries

so there are 5 new queries;)
You probably using the threads widgets, it won't follow the cache rule if you are logged in. Permission issue ;)
 
This looks really interesting. However, will this also take care of other addons which have placed things in the side bar before? If not, could there be a way to somehow be able to manage where they are located as well? Because I really like the idea, but if it only works with side bar things that are specifically created as a widget for your addon, it wouldn't be nearly as useful..
Sorry, it's not possible. Please please please other developers adopt this framework :P

Hi

Only a question. Why are checkboxes on the "List Widgets"-page? You are only able to see the status on this page but your not able to change the status there.
Actually you can enable and disable with the checkbox. If it doesn't work for you, hmm... check if you uploaded js/widget_framework/functions.js?
 
ok i've found the problem

The message "widget saved successfully" is shown always, even if there's a error!
If i save & exit, i see the error, if i only save it, i see the successfully message, event there was a problem;)


There's a small template bug
it should be "delete widget" and not delete template;)
My bad :oops:

Please note:
  1. xf_widget doesn't store information about renderer, that tables stores the widgets only
  2. You shouldn't extends that class, please use the WidgetFramework_WidgetRenderer or at least use WidgetFramework_WidgetRenderer_Users :D
  3. When you extend the class, you will need the 2 template methods: 1 for the options page and 1 for the widget rendering
Thank you for trying the framework ;)
 
This is one of the best addons I've seen on any platform. And I'm going to use it. But it doesn't like Taiga Chat. If I could get the chatbox to work it would be perfect.
 
I like it! Will it show only the latest poll?

Edit: Never mind. When I make it full screen I see that you can either specify a thread to be displayed or it'll show the last poll created. Very nice!
 
This is awsome as it it but I'd like to see widgets like Most trophys, likes, facebook fan box. There are a lot of addons that needs to be removed right now, that I've installed and this is just amazing :)
 
Status
Not open for further replies.
Top Bottom