MyBB Hacks

Full Version: My Feature Ideas
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Thanks, Yumi Smile
I have a suggestion - it may already exist, but it would be handy if the thread grouping on forumdisplay_threadlist could be defined as a variable or something that gives us control at template level rather than in forum options.

An example of where I might want to use this is if I have a layout that I want to be able to scale up/down depending on the users browser.

If I am viewing on a monitor at home from my PC then having three columns in a layout makes sense; however, if I am viewing from my phone, then a single column might be better.

I hope this was a clear suggestion.
One column would be easy to do - just hardcode all the wrappers in the thread template and blank out the separator template.

Otherwise, for a more general case, this plugin should do it:

PHP Code:
function something_info() {
  return array(/*stick random info here*/);
}
$plugins->add_hook('forumdisplay_start', 'something_run');
function something_run() {
  global $foruminfo;
  if($foruminfo['fid'] != 2) return;
  $foruminfo['xthreads_grouping'] = (MOBILE ? 1:3);
}

Thank you Zinga. I see what the code is doing, I understand how to make it into a "plugin" for mybb, but I am not totally clear how to implement it.

I see you have the MOBILE ? 1:3 in there, but that is about it. However, I wonder if it would be possible to use that as a basis for a conditional, in the template?
I guess you could try something like this:

Code:
<setvar threadcount>$tplvars['threadcount'] + 1</setvar>
<if $tplvars['threadcount'] % 3 == 0 then>
<!-- will show every 3 threads -->
</if>

For images, it would be cool if you could set a fixed-size for a thumbnail and the plugin would crop a section of the image out automatically, e.g. so you could have a row of thumbnails all the same size (see: http://dribbble.com/)
Interesting.  So scale down, then crop?  I wonder also how to represent that in the setting...
maybe for a fixed size thumbnail you could use *, so like

800x600|90*90|

etc. I don't know if this would work.
I've thought about it - maybe I'll do a filter-chain type implementation:

Code:
800x600|320x240|mythumb=scale_min(90,90),crop_cm(90,90)


Where scale_min = scale image so that it is at least the size specified (90x90), crop_cm = crop from center-middle to 90x90.

that would be perfect! i thought of asking for a specification of where to crop from but thought it might be too much
Pages: 1 2 3 4 5 6
Reference URL's