Clarification of some code..

Ok.. well i’ve temporally moved off the releases engine to focus on MTF’s base. So right now I am going through the code and “trimming” the um-needed code. While going through some of your original code was there and i am trying to figure out what it is there for and if i should keep it or not. Here are the code samples:
From plugin ‘Add default details on Add Forum’:

$forum[‘mtf_inpost’] = $vbulletin->options[‘mtf_inpost’];
$forum[‘mtf_highlight’] = $vbulletin->options[‘mtf_highlight’];
$forum[‘mtf_attachlimit’] = $vbulletin->options[‘mtf_attachlimit’];
$forum[‘mtf_feature’] = $vbulletin->options[‘mtf_feature’];
[/CODE]

From plugin ‘Add Highlight Effect on Showthread’:

if($foruminfo[‘mtf_type’] != ‘default’ AND $foruminfo[‘mtf_highlight’] == ‘lightbox’)
{
global $header, $headinclude;
$headinclude .= ‘






‘;
}

From plugin ‘deactivate the Attachment Manager if member have no permission in editpost’:

if($foruminfo[‘mtf_type’] AND $foruminfo[‘mtf_type’] != ‘default’ AND !can_moderate() AND $foruminfo[‘mtf_inpost’])
{
switch($foruminfo[‘mtf_inpost’])
{
case ‘1’: # if the thread author only can post AND only in firstpost
if($postinfo[‘postid’] != $threadinfo[‘firstpostid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
case ‘2’: # if the thread author only can post
if($vbulletin->userinfo[‘userid’] != $threadinfo[‘postuserid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
default: # choice #3, anybody can post!
break;
}
}

From plugin in location forumdata_start (partial code):

$this->validfields[‘mtf_postbit’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_authorbio’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_reflink’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_firstpost’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_highlight’] = array(TYPE_STR, REQ_NO);
$this->validfields[‘mtf_attachlimit’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_feature’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_inpost’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_threadpreview’] = array(TYPE_UINT, REQ_NO);

$forum = $vbulletin->options;
$forum = $vbulletin->options;
$forum = $vbulletin->options;
$forum = $vbulletin->options;

From plugin ‘Add Highlight Effect on Showthread’:
if($foruminfo[‘mtf_type’] != ‘default’ AND $foruminfo[‘mtf_highlight’] == ‘lightbox’)
{
global $header, $headinclude;
$headinclude .= ‘






‘;
}
[/CODE]

From plugin ‘deactivate the Attachment Manager if member have no permission in editpost’:

if($foruminfo[‘mtf_type’] AND $foruminfo[‘mtf_type’] != ‘default’ AND !can_moderate() AND $foruminfo[‘mtf_inpost’])
{
switch($foruminfo[‘mtf_inpost’])
{
case ‘1’: # if the thread author only can post AND only in firstpost
if($postinfo[‘postid’] != $threadinfo[‘firstpostid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
case ‘2’: # if the thread author only can post
if($vbulletin->userinfo[‘userid’] != $threadinfo[‘postuserid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
default: # choice #3, anybody can post!
break;
}
}

From plugin in location forumdata_start (partial code):

$this->validfields[‘mtf_postbit’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_authorbio’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_reflink’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_firstpost’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_highlight’] = array(TYPE_STR, REQ_NO);
$this->validfields[‘mtf_attachlimit’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_feature’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_inpost’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_threadpreview’] = array(TYPE_UINT, REQ_NO);
if($foruminfo != ‘default’ AND $foruminfo == ‘lightbox’)
{
global $header, $headinclude;
$headinclude .= ‘






‘;
}

From plugin ‘deactivate the Attachment Manager if member have no permission in editpost’:
if($foruminfo[‘mtf_type’] AND $foruminfo[‘mtf_type’] != ‘default’ AND !can_moderate() AND $foruminfo[‘mtf_inpost’])
{
switch($foruminfo[‘mtf_inpost’])
{
case ‘1’: # if the thread author only can post AND only in firstpost
if($postinfo[‘postid’] != $threadinfo[‘firstpostid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
case ‘2’: # if the thread author only can post
if($vbulletin->userinfo[‘userid’] != $threadinfo[‘postuserid’]) unset($vbulletin->userinfo[‘attachmentextensions’]);
break;
default: # choice #3, anybody can post!
break;
}
}
[/CODE]

From plugin in location forumdata_start (partial code):

$this->validfields[‘mtf_postbit’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_authorbio’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_reflink’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_firstpost’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_highlight’] = array(TYPE_STR, REQ_NO);
$this->validfields[‘mtf_attachlimit’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_feature’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_inpost’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_threadpreview’] = array(TYPE_UINT, REQ_NO);
if($foruminfo AND $foruminfo != ‘default’ AND !can_moderate() AND $foruminfo)
{
switch($foruminfo)
{
case ‘1’: # if the thread author only can post AND only in firstpost
if($postinfo != $threadinfo) unset($vbulletin->userinfo);
break;
case ‘2’: # if the thread author only can post
if($vbulletin->userinfo != $threadinfo) unset($vbulletin->userinfo);
break;
default: # choice #3, anybody can post!
break;
}
}

From plugin in location forumdata_start (partial code):
$this->validfields[‘mtf_postbit’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_authorbio’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_reflink’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_firstpost’] = array(TYPE_BOOL, REQ_NO);
$this->validfields[‘mtf_highlight’] = array(TYPE_STR, REQ_NO);
$this->validfields[‘mtf_attachlimit’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_feature’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_inpost’] = array(TYPE_UINT, REQ_NO);
$this->validfields[‘mtf_threadpreview’] = array(TYPE_UINT, REQ_NO); [/CODE]

$this->validfields = array(TYPE_BOOL, REQ_NO);
$this->validfields = array(TYPE_BOOL, REQ_NO);
$this->validfields = array(TYPE_BOOL, REQ_NO);
$this->validfields = array(TYPE_BOOL, REQ_NO);
$this->validfields = array(TYPE_STR, REQ_NO);
$this->validfields = array(TYPE_UINT, REQ_NO);
$this->validfields = array(TYPE_UINT, REQ_NO);
$this->validfields = array(TYPE_UINT, REQ_NO);
$this->validfields = array(TYPE_UINT, REQ_NO);

Views: 4

Partager :

3 thoughts on “Clarification of some code..”

  1. nexia dit :

    for first block:
    apply to a forum creation the global settings (in vbulletin options) that you set for all your engines. i think it was a plugin created when i created the Attachment Album, where you were able to set the default settings for these features, and able to edit these default per forum.

    second block:
    highlight was created for the Attachment album, before vb 3.7 when they added a lightbox setting globally… mine was created before this: The Image Resizer. Powered with Lytebox / Highslide / Lightview / and many more! – vBulletin.org Forum … made to activate per forum a style of lightbox… because you can choose a more accurate style per forum.

    third block:
    this was the best way to deactivate access to attachments manager depending on the type of attachment albums you prefer for that forum… i was missing a word here: “if the thread author only can post attachments AND only in firstpost”

    block four…
    you are replacing the whole thing actually, as you said the settings and configs per forums would be different. this one was to save these settings per forum by default instead of using a cache…

    😉

    remember, i’m a moron at coding, my descriptions and usages are not clear… only my ideas are…

  2. Drew dit :

    Now for the real question which ones are required for MTF?

  3. nexia dit :

    basic ones, the default features…

    forget the lightbox for sure, i’ll have a seperate addon for this, where once you upload the lightbox of your choice it become available with the proper plugin to activate it and show it properly…

    actually you can drop them all for the MTF Core… as you now cache the info, they are no need for defaults…

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.

En savoir plus sur Un Papa Pro

Abonnez-vous pour poursuivre la lecture et avoir accès à l’ensemble des archives.

Continue reading