PDA

View Full Version : Invalid Modules - fixable?


vgevolution
02-20-2008, 12:48 PM
I have a module for vblogetin that was written for 3.0 RC2 apparently, and will not upload to 3.0 Gold. I keep getting the "The file you have uploaded is not a valid module file." Is there any way to fix this module so it will work? I can't get support over there since the developers are AWOL. I can't see anything out of the ordinary, but without any module tutorials to work from on here, I'm not sure where to start. Here's the code (plus it's attached in a zip):

a:4:{s:6:"module";s:339:"a:12:{s:5:"title";s:9:"Blog News";s:10:"identifier";s:10:"cheesewhiz";s:8:"filename";s:12:"blognews.php";s:7:"inctype";s:8:"php_file";s:6:"parent";s:0:"";s:12:"templatelist";s:23:"adv_portal_blognewsbits";s:7:"colspan";s:1:"0";s:8:"formcode";s:0:"";s:11:"cleanoutput";s:1:"0";s:7:"options";s:0:"";s:8:"useshell";s:1:"1";s:4:"link";s:0:"";}";s:9:"templates";s:1559:"a:1:{s:23:"adv_portal_blognewsbits";s:1512:"<tr valign="middle" border=<if condition="$entry['featured']">1<else />0</if>">
<td class="thead">
<a href="$entry[url]">$entry[title]</a>
</td>
</tr>
<tr>
<td class="alt2">
<if condition="$entry['timesrated']">
<span style="float:$stylevar[right]"><img src="$stylevar[imgdir_rating]/rating_$entry[rating].gif" alt="<phrase 1="$entry[timesrated]" 2="$entry[rating]">$vbphrase[blog_rating_x_votes_y_average]</phrase>" /></span>
</if>
<div style="margin-top: 2px; margin-bottom: 2px;" class="smallfont">posted $entry[date] by <a href="member.php?{$sID}u=$entry[userid]">$entry[username]</a>, in <a href="$entry[categoryURL]">$entry[category]</a></div>
</td>
</tr>
<tr>
<td class="alt1">
$entry[body]
<if condition="$show['more']">
<span class="smallfont"><a title="$vbphrase[blog_read_more]" href="$entry[url]">$vbphrase[blog_more]</a> <a href="$entry[url]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[blog_read_more]" border="0" /></a></span>
</if>
</td>
</tr>
<tr>
<td class="alt2">
<div class="smallfont" style="margin-top: 3px; text-align: right">
<if condition="$show['viewComments']">$entry[comments] Comments - </if>
<if condition="$show['editEntry']"><a href="$blogURL/entry.php?{$sID}entry=$entry[entryid]">Edit Entry</a></if>
<if condition="$show['postComment']"> - <a href="$blogURL/comment.php?{$sID}entry=$entry[entryid]">Post Comment</a></if>
</div>
</td>
</tr>";}";s:4:"file";s:3162:"<?php

// this is hugh's CMPS release version of this module, it is NOT the version
// we use on the home page at www.vblogetin.com.

if ($mod_options['cheesewhiz_userid'])
{
$userid = $mod_options['cheesewhiz_userid'];
$catids = $mod_options['cheesewhiz_catids'] ? $mod_options['cheesewhiz_catids'] : '';
$maxEntries = $mod_options['cheesewhiz_maxentries'] ? $mod_options['cheesewhiz_maxentries'] : $vbulletin->options['blog_top_blogs_limit'];;
$maxLength = $mod_options['cheesewhiz_max_length'] ? $mod_options['cheesewhiz_max_length'] : 0;

global $blog, $blogURL, $sID, $sIDq, $show;

$entryParsing = convert_bits_to_array($int = $blog->option('parse_entry'), $blog->parsingLookup);

require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$blogsettings =& $blog->viewBlog($userid);

setBlogUserid($userid);

$blogCheck =& initCheck();
$blogCheck->pass($blogsettings, 'blogsettings');

require_once(BLOG_INCLUDES . '/class_blogEntry.php');
$dmEntry =& new blogEntry();

$dmEntry->alterQuery('drafts', false);
$dmEntry->alterQuery('invisible', false);
$dmEntry->alterQuery('private', 0);
$dmEntry->alterQuery('deleted', 0);
$dmEntry->alterQuery('userid', $userid);
if ($catids) {
$dmEntry->alterQuery('categoryid', explode(',', $catids));
}

$total = $dmEntry->viewTotalEntries($entryid);
$dmEntry->queryLimit = $maxEntries;

$entrybits = '';
$entries = $dmEntry->viewEntries();

//$categories = $blog->getUserDatastoreFile($userid, 'categories');

foreach ($entries as $entry)
{
$blogCheck =& initCheck();
$blogCheck->pass($entry, 'entry');
$blogCheck->pass($blogsettings, 'blogsettings');

if ($maxLength) {
$entry['body'] = cutOffString($entry['body'], $maxLength, '', DO_CLOSE_BBCODE);
}

$entry['body'] = $parser->do_parse($entry['body'],
$entryParsing['html'],
$entryParsing['smilies'],
$entryParsing['bbcode'],
$entryParsing['images'],
$entryParsing['lines'],
false
);

//$entry['category'] = $categories[$entry['categoryid']]['title'];
$entry['category'] = $blog->category($entry['categoryid']);

$entry['date'] = $blog->date($entry['dateline']);

if (strpos($entry['date'], '-') !== false)
{
$entry['date'] = explode(' ', $entry['date']);
$entry['date'] = $entry['date'][0];
}

$entry['date'] = str_replace(
array(
'Today',
'Yesterday'
),
array(
'<span class="highlight">Today</span>',
'<span class="semihighlight">Yesterday</span>'
),
$entry['date']
);

$entry['image'] = 'images/news/' . str_replace(' ', '_', strtolower($entry['category'])) . '.gif';

$entry['url'] = constructEntryURL($entry,$blogsettings);
$entry['categoryURL'] = constructCategoryURL($entry,$blogsettings);

$show['editEntry'] = $blogCheck->can('editEntry');
$show['viewComments'] = $blogCheck->can('viewComments');
$show['postComment'] = $blogCheck->can('postComment');
$show['deleteComment'] = $show['editEntry'];

eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_blognewsbits') . '";');
}
}
?>
";s:8:"settings";a:4:{s:17:"cheesewhiz_userid";a:8:{s:7:"varname";s:17:"cheesewhiz_userid";s:10:"grouptitle";s:21:"adv_portal_cheesewhiz";s:5:"value";s:1:"1";s:12:"defaultvalue";s:1:"1";s:10:"optioncode";s:0:"";s:12:"displayorder";s:2:"10";s:5:"title";s:6:"UserID";s:11:"description";s:22:"UserID of blog to use.";}s:17:"cheesewhiz_catids";a:8:{s:7:"varname";s:17:"cheesewhiz_catids";s:10:"grouptitle";s:21:"adv_portal_cheesewhiz";s:5:"value";s:0:"";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:0:"";s:12:"displayorder";s:2:"20";s:5:"title";s:13:"Category ID's";s:11:"description";s:112:"Category ID(s) to use. Seperate multiple ID's with commas. Leave blank if you want to include all catgegories.";}s:21:"cheesewhiz_maxentries";a:8:{s:7:"varname";s:21:"cheesewhiz_maxentries";s:10:"grouptitle";s:21:"adv_portal_cheesewhiz";s:5:"value";s:2:"10";s:12:"defaultvalue";s:2:"10";s:10:"optioncode";s:0:"";s:12:"displayorder";s:1:"0";s:5:"title";s:11:"Max Entries";s:11:"description";s:34:"Maximum number of entries to show.";}s:21:"cheesewhiz_max_length";a:8:{s:7:"varname";s:21:"cheesewhiz_max_length";s:10:"grouptitle";s:21:"adv_portal_cheesewhiz";s:5:"value";s:3:"600";s:12:"defaultvalue";s:3:"300";s:10:"optioncode";s:0:"";s:12:"displayorder";s:1:"4";s:5:"title";s:10:"Max Length";s:11:"description";s:172:"Maximum length (in characters, not words) for each blog entry, before being trimmed and a "more..." link is added. Set to 0 to disable this and allow full length entries.";}}}

Any help at all would be appreciated, since I'm out of options, and I need this module to upload ASAP. Thanks!

If there's actually a place describing how to create/fix modules, please point me there, since I've done multiple searches and come up empty.

vgevolution
02-20-2008, 07:49 PM
Never mind, I was able to decipher the serialized code and create the module manually from the raw file.