News:

Wondering if this will always be free?  See why free is better.

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

InfoStrides

Quote from: AngelinaBelle on April 04, 2011, 06:55:45 AM
Try removing one portal block at a time, to see if you can figure out if one of them is causing the slowdown.
Another possibility is that you simply have too much going on at the portal page for what your database host allows in in database power.
You will have to experiment a bit to narrow it down.

Thanks. I will do just that.

xrunner

I have checked how Simple Portal looks on several computers using the IE browser and it does not look correct under IE, but does under other browser (FF, Chrome).
The entire right hand column is not appearing. Also, the middle boxes are reversed (top to bottom) from what they should be (looks OK under FF and Chrome).

It is not the theme because it happens under the default theme.

What is the problem? I want my portal to appear correct for all users out there.

Angelina Belle

Sounds like you might have some bad HTML on the page.
IE sometimes handles incorrect HTML more gracefully -- the other browsers make some guesses about "what you really meant".

Please submit the page to an HTML validator.

What version of SimplePortal are you using? What version of SMF? Are you using the "no body" option on any of your blocks?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

xrunner

Quote from: AngelinaBelle on April 10, 2011, 12:25:34 PM
Sounds like you might have some bad HTML on the page.
IE sometimes handles incorrect HTML more gracefully -- the other browsers make some guesses about "what you really meant".

I don't "mean" anything - I didn't code the pages, I just installed the Simple Portal mod. All the code came from it ...

Quote
What version of SimplePortal are you using? What version of SMF? Are you using the "no body" option on any of your blocks?

SP 2.3.3, SMF 2.0 RC5

But -

I have figured out the issue with Simple Portal and IE this morning - it has to do with the following controls -

Width of Left Side Blocks
Width of Right Side Blocks


If you decide to use percentages, such as 50%, IE will not display the page properly. If you use pixels, IE will display it properly. There must be a compatibility or coding issue with Simple Portal's percentage sizing method that works differently in IE than the other browsers. Again, all that comes from the mod installation - not the user!

I bet you if the Simple Portal support page were to test this out, they would see the same issue with IE. Right now I can tell they are not using the percentage size option for the left and right side blocks.

Angelina Belle

You know -- I was just guessing about what kinds of things often cause these types of errors.
It was most helpful to see a link to the page in your post at the SimplePortal website.
I think that narrowed it down.

Thank you for providing the information we need to help you.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

w0lfman

I'm using SMF 1.1.13 and after installing the MOD all I get is the error message below.  Is anyone familiar with the message after install the Simple Portal MOD?  I cant even get to my ADmin Control Panel to remove the MOD.  I attached a picture of the actual problem as well.


<?php

if (!defined('SMF'))
die('Hacking attempt...');

/*

File: Subs-SPortal1-1.php
Version: SimplePortal 2.1.1 for SMF 1.x

getBlockInfo()
getFunctionInfo()
getCategoryInfo()
getArticleInfo()
createArticle()
fixCategoryArticles()
fixColumnRows()
changeBlockRow()
changeState()
sp_loadPermissions()
spAllowedTo()
sp_loadMemberGroups()
loadDatabaseTables()
databaseTableExists()

*/

function getBlockInfo($column_id null$block_id null$state null$show null)
{
global $scripturl$context$db_prefix$settings$txt;

$query = array();
if(!empty($column_id))
$query[] = "col = '$column_id'";
if(!empty($block_id))
$query[] = "ID_BLOCK = '$block_id'";
if(!empty($state))
$query[] = "state = '1'";

$request db_query("
SELECT ID_BLOCK, label, type, content, parameters, col, row, state, force_view, allowed_groups, permission_type, display
FROM 
{$db_prefix}sp_blocks" .
(!empty($query) ? " WHERE " implode(' AND '$query) : "") .
" ORDER BY row"__FILE____LINE__);
$return = array();
while ($row mysql_fetch_assoc($request))
{
if(!empty($show) && !getShowInfo($row['ID_BLOCK'], $row['display']))
continue;

if(!spAllowedTo('block'$row['ID_BLOCK']))
continue;

$return[] = array(
'id' => $row['ID_BLOCK'],
'label' => $row['label'],
'type' => $row['type'],
'type_text' => !empty($txt['sp_function_'.$row['type'].'_label']) ? $txt['sp_function_'.$row['type'].'_label'] : $txt['sp_function_unkown_label'],
'content' => $row['content'],
'parameters' => $row['parameters'],
'column' => $row['col'],
'row' => $row['row'],
'state' => empty($row['state']) ? 1,
'force_view' => $row['force_view'],
'allowed_groups' => $row['allowed_groups'],
'permission_type' => $row['permission_type'],
'display' => $row['display'],
);
}
mysql_free_result($request);

return $return;
}

function 
getFunctionInfo($function null)
{
global $db_prefix;

$request db_query("
SELECT ID_FUNCTION, name, parameter
FROM 
{$db_prefix}sp_functions" .
(!empty($function) ? " WHERE name = '$function'" "") .
" ORDER BY ID_FUNCTION ASC"__FILE____LINE__);
$return = array();
while ($row mysql_fetch_assoc($request))
{
//There is one function who is not allowed to use by non admins
if($row['name'] == 'sp_php' && !allowedTo('admin_forum'))
continue;
$return[] = array(
'id' => $row['ID_FUNCTION'],
'function' => $row['name'],
'parameter' => $row['parameter'],
);
}
mysql_free_result($request);

return $return;
}

function 
getCategoryInfo($category_id null)
{
global $scripturl$context$db_prefix$settings$txt;

$request db_query("
SELECT ID_CATEGORY, name, picture, articles, publish
FROM 
{$db_prefix}sp_categories" .
(!empty($category_id) ? " WHERE ID_CATEGORY = '$category_id'" "") .
" ORDER BY ID_CATEGORY"__FILE____LINE__);
$return = array();
while ($row mysql_fetch_assoc($request))
{

$return[] = array(
'id' => $row['ID_CATEGORY'],
'name' => $row['name'],
'picture' => array (
'href' => $row['picture'],
'image' => '<img src="' $row['picture'] . '" alt="' $row['name'] . '" width="75" />',
),
'articles' => $row['articles'],
'publish' => $row['publish'],
);
}
mysql_free_result($request);

return $return;
}

function 
getArticleInfo($article_id null$category_id null$message_id null$approved null)
{
global $db_prefix;

$query = array();
if(!empty($article_id))
$query[] = "ID_ARTICLE = '$article_id'";
if(!empty($category_id))
$query[] = "ID_CATEGORY = '$category_id'";
if(!empty($message_id))
$query[] = "ID_MESSAGE = '$message_id'";
if(!empty($approved))
$query[] = "approved = '1'";

$request db_query("
SELECT a.ID_ARTICLE, a.ID_CATEGORY, a.ID_MESSAGE, a.approved, c.name
FROM 
{$db_prefix}sp_articles as a
LEFT JOIN 
{$db_prefix}sp_categories AS c ON (c.ID_CATEGORY = a.ID_CATEGORY)" .
(!empty($query) ? " WHERE " implode(' AND '$query) : "") .
" ORDER BY ID_ARTICLE"__FILE____LINE__);
$return = array();
while ($row mysql_fetch_assoc($request))
{

$return[] = array(
'article' => array(
'id' => $row['ID_ARTICLE'],
'approved' => $row['approved'],
),
'category' => array(
'id' => $row['ID_CATEGORY'],
'name' => $row['name'],
),
'message' => array(
'id' => $row['ID_MESSAGE'],
),
);
}
mysql_free_result($request);

return $return;
}

function 
createArticle($articleOptions)
{
global $db_prefix;

$articleOptions['ID_CATEGORY'] = !empty($articleOptions['ID_CATEGORY']) ? (int) $articleOptions['ID_CATEGORY'] : 0;
$articleOptions['ID_MESSAGE'] = !empty($articleOptions['ID_MESSAGE']) ? (int) $articleOptions['ID_MESSAGE'] : 0;
$articleOptions['approved'] = !empty($articleOptions['approved']) ? (int) $articleOptions['approved'] : 0;

$request db_query("
SELECT ID_MESSAGE
FROM 
{$db_prefix}sp_articles
WHERE ID_MESSAGE = '
$articleOptions[ID_MESSAGE]'
LIMIT 1"
__FILE____LINE__);
list ($exists) = mysql_fetch_row($request);
mysql_free_result($request);

if(empty($articleOptions['ID_CATEGORY']) || empty($articleOptions['ID_MESSAGE']) || $exists)
return false;

db_query("
INSERT INTO 
{$db_prefix}sp_articles
(ID_CATEGORY, ID_MESSAGE, approved)
VALUES ('
$articleOptions[ID_CATEGORY]', '$articleOptions[ID_MESSAGE]', $articleOptions[approved])"__FILE____LINE__);

db_query("
UPDATE 
{$db_prefix}sp_categories
SET articles = articles + 1
WHERE ID_CATEGORY = 
$articleOptions[ID_CATEGORY]
LIMIT 1"
__FILE____LINE__);
}

function 
fixCategoryArticles()
{
global $db_prefix;

$categoryList getCategoryInfo();
$category_ids = array();

foreach($categoryList as $category)
$category_ids[] = $category['id'];

foreach($category_ids as $category) {

$article_count 0;

$result db_query("
SELECT COUNT(*)
FROM 
{$db_prefix}sp_articles
WHERE ID_CATEGORY = 
$category"__FILE____LINE__);
list ($article_count) = mysql_fetch_row($result);
mysql_free_result($result);

db_query("
UPDATE 
{$db_prefix}sp_categories
SET articles = 
$article_count
WHERE ID_CATEGORY = 
$category
LIMIT 1"
__FILE____LINE__);
}
}

function 
fixColumnRows($column_id null)
{
global $db_prefix;

$blockList getBlockInfo($column_id);
$block_ids = array();

foreach($blockList as $block)
$block_ids[] = $block['id'];

$counter 0;

foreach($block_ids as $block) {

$counter $counter 1;

db_query("
UPDATE 
{$db_prefix}sp_blocks
SET row = 
$counter
WHERE ID_BLOCK = 
$block
LIMIT 1"
__FILE____LINE__);
}
}

function 
changeBlockRow($block_id null$direction null)
{
global $db_prefix;

$blockInfo getBlockInfo(null$block_id);
$blockInfo $blockInfo[0];

db_query("
UPDATE 
{$db_prefix}sp_blocks
SET row = 
$blockInfo[row]
WHERE row = 
$blockInfo[row] " . ($direction == 'up' "-" "+") . " 1
AND col = 
$blockInfo[column]
LIMIT 1"
__FILE____LINE__);

db_query("
UPDATE 
{$db_prefix}sp_blocks
SET row = row " 
. ($direction == 'up' "-" "+") . " 1
WHERE ID_BLOCK = 
$block_id
AND col = 
$blockInfo[column]
LIMIT 1"
__FILE____LINE__);
}

function 
changeState($type null$id null)
{
global $db_prefix;

if($type == 'block')
$query = array(
'column' => 'state',
'table' => 'blocks',
'id' => 'ID_BLOCK'
);
elseif($type == 'category')
$query = array(
'column' => 'publish',
'table' => 'categories',
'id' => 'ID_CATEGORY'
);
elseif($type == 'article')
$query = array(
'column' => 'approved',
'table' => 'articles',
'id' => 'ID_ARTICLE'
);
else
return false;

$request db_query("
SELECT 
$query[column]
FROM 
{$db_prefix}sp_$query[table]
WHERE 
$query[id] = $id
LIMIT 1"
__FILE____LINE__);
list ($state) = mysql_fetch_row($request);
mysql_free_result($request);

$state = (int) $state;
$state = ($state == 1) ? ;

db_query("
UPDATE 
{$db_prefix}sp_$query[table]
SET 
$query[column] = $state
WHERE 
$query[id] = $id
LIMIT 1"
__FILE____LINE__);
}

// Make the allowed check faster, because i can cache this data!
// force_view is used for the way to make 3 diffrent ways to check blocks!
function sp_loadPermissions($type null) {
global $db_prefix$sp_context$user_info;

//Checkup
if(empty($type) || !in_array($type, array('block''article'))) 
return false;

//Prevent double load :)
if(!isset($sp_context['permissions'][$type]))
$sp_context['permissions'][$type] = array();
else
return !empty($sp_context['permissions'][$type]); //On false allowed to nothing ;P

//Blockquery Informations :)
if($type == 'block') {
// Get the necessary block information.
$request db_query("
SELECT allowed_groups AS allowed_groups, id_block AS id, permission_type
FROM 
{$db_prefix}sp_blocks
WHERE (permission_type = 2 
OR (FIND_IN_SET(" 
implode(', allowed_groups) OR FIND_IN_SET('$user_info['groups']) . ", allowed_groups)))"__FILE____LINE__);
}
else {
// Get the necessary block information.
$request db_query("
SELECT allowed_groups AS allowed_groups, id_article AS id
FROM 
{$db_prefix}sp_articles
WHERE (FIND_IN_SET(" 
implode(', allowed_groups) OR FIND_IN_SET('$user_info['groups']) . ", allowed_groups))"__FILE____LINE__);
}

//The output will only show the allowed positions ;D
while($row mysql_fetch_assoc($request)) {
//This Permission need a extra checkup 8), it's a faster query now, a lot faster!
if(!empty($row['permission_type']) && $row['permission_type'] == 1) {
if(count(array_intersect($user_info['groups'], explode(','$row['allowed_groups']))) != count($user_info['groups']))
continue;
}
$sp_context['permissions'][$type][$row['id']] = $row['id'];
}
mysql_free_result($request);

//Okay chached it ;) now it should be faster... a lot faster 8)
return !empty($sp_context['permissions'][$type]);
}

// Function to check if users are allowed to view certain blocks.
function spAllowedTo($type null$id null)
{
global $sp_context;
// SP moderators are supermen. :D i need to do nothing if this correct! It's to late checked!
// And this is the reason why admin unselect never work!
// If we like to fix this we need to think about a way to allowed it in a other way or insert a force admin check
if(allowedTo('sp_moderate'))
return true;
// Sanitize the ID.
$id = (int) $id;
// Make sure that we have a proper id, load Permissions and store a chache 
if(empty($id) || sp_loadPermissions($type) === false || empty($type))
return false;
//Pah if it isset than you allowed, if not than not :)
return isset($sp_context['permissions'][$type][$id]);
}

/*
void sp_loadMemberGroups(Array $selectedGroups = array, Array $removeGroups = array(), string $show = 'normal', string $contextName = 'member_groups')
This will file the $context['member_groups'] to the given options
$selectedGroups means all groups who should be shown as selcted, if you like to check all than insert an 'all'
You can also Give the function a string with '2,3,4'
$removeGroups this group id should not shown in the list
$show have follow options
'normal' => will show all groups, and add a guest and regular member (Standard)
'post' => will load only post groups
'master' => will load only not postbased groups
$contextName where the datas should stored in the $context;

The Administrator group id 1 will evertime ignored!
*/
function sp_loadMemberGroups($selectedGroups = array(), $show 'normal'$contextName 'member_groups')  {
global $db_prefix$context$smcFunc$txt;

//Some additional Language stings are needed
loadLanguage('ManageBoards');

// Make sure its empty
$context[$contextName] = array();

//Preseting some things :)
if(!is_array($selectedGroups))
$checked strtolower($selectedGroups) == 'all';
else
$checked false;

if(!$checked && !empty($selectedGroups)) {
if(!is_array($selectedGroups)) 
$selectedGroups explode(','$selectedGroups);
//Remove all strings, i will only allowe ids :P
foreach($selectedGroups as $k => $i)
$selectedGroups[$k] = (int) $i;
$selectedGroups array_unique($selectedGroups);
}
else
$selectedGroups = array();

//Okay let's checkup the show function
$show_option = array(
'normal' => 'ID_GROUP != 1',
'post' => 'minPosts != -1',
'master' => 'minPosts = -1 AND ID_GROUP != 1',
);
$show strtolower($show);
if(!isset($show_option[$show]))
$show 'normal';

// Guest and Members are added manually. Only on normal ond master View =)
if($show == 'normal' || $show == 'master') {
$context[$contextName][-1] = array(
'id' => -1,
'name' => $txt['membergroups_guests'],
'checked' => $checked || in_array(-1$selectedGroups),
'is_post_group' => false,
);
$context[$contextName][0] = array(
'id' => 0,
'name' => $txt['membergroups_members'],
'checked' => $checked || in_array(0$selectedGroups),
'is_post_group' => false,
);
}

// Load membergroups.
$request db_query("
SELECT groupName, ID_GROUP, minPosts
FROM 
{$db_prefix}membergroups
WHERE "
.$show_option[$show]."
ORDER BY minPosts, ID_GROUP != 2, groupName"
,__FILE____LINE__);
while ($row mysql_fetch_assoc($request))
{
$context[$contextName][(int) $row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => trim($row['groupName']),
'checked' => $checked || in_array($row['ID_GROUP'], $selectedGroups),
'is_post_group' => $row['minPosts'] != -1,
);
}
mysql_free_result($request);
}

function 
sp_queryFix($tourniquet)
{
global $sportal_version$context;

if (SMF == 'SSI' || empty($context['template_layers']) || WIRELESS)
return $tourniquet;

$fix str_replace('{version}'$sportal_version'<a href="http://www.simpleportal.net/" target="_blank">SimplePortal {version}</a>');

$tourniquet preg_replace(base64_decode('figsIFNpbXBsZSBNYWNoaW5lcyBMTEM8L2E+KX4='), base64_decode('LCBTaW1wbGUgTWFjaGluZXMgTExDPC9hPjxiciAvPg==') . $fix$tourniquet);

if (strpos($tourniquet'www.simpleportal.net') === false)
{
$fix '<div class="smalltext" style="text-align: center; width: 100%;">' $fix '</div>';
$tourniquet preg_replace('~</body>\s*</html>~'$fix$tourniquet);
}

return $tourniquet;
}

// Function to get a block's display/show information.
function getShowInfo($block_id null$display null)
{
global $db_prefix$context$modSettings;

// Do we have the display info?
if(empty($display))
{
// Make sure that its an integer.
$block_id = (int) $block_id;

// We need an ID.
if(empty($block_id))
return false;

// Get the info.
$request db_query("
SELECT display
FROM 
{$db_prefix}sp_blocks
WHERE ID_BLOCK = 
$block_id
LIMIT 1"
__FILE____LINE__);
list ($display) = mysql_fetch_row($request);
mysql_free_result($request);
}

// Some variables for ease.
$action = !empty($context['current_action']) ? $context['current_action'] : '';
$board = !empty($context['current_board']) ? $context['current_board'] : '';
$portal = (empty($action) && empty($board)) ? true false;

// Set some action exceptions.
$exceptions = array(
'post' => array('announce''editpoll''post2''sendtopic'),
'register' => array('activate''coppa'),
'forum' => array('collapse'),
'admin' => array('credits''theme''viewquery''admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers''spadmin'),
'login' => array('reminder'),
'profile' => array('trackip''viewprofile'),
);

// Set the action to more known one.
foreach($exceptions as $key => $exception)
{
if(in_array($action$exception))
$action $key;
}

// If no display info and/or integration disabled and we are on portal; show it!
if((empty($display) || empty($modSettings['sp_enableIntegration'])) && $portal)
return true;
// No display info and/or integration disabled and no portal; no need...
elseif(empty($display) || empty($modSettings['sp_enableIntegration']))
return false;
// Get ready for real action if you haven't yet.
elseif(!is_array($display))
$display explode(', '$display);

// Did we disable all blocks for this action?
if(!empty($modSettings['sp_' $action 'IntegrationHide']))
return false;
// If we will display show the block.
elseif(in_array('all'$display))
return true;
// If we are on portal, show portal blocks; if we are on forum, show forum blocks.
elseif(($portal && (in_array('portal'$display) || in_array('sportal'$display))) || (!$portal && in_array('sforum'$display)))
return true;
// If current action or board is in display info; or we should display block in all actions or all boards then you can display block.
elseif((!empty($action) && (in_array('allaction'$display) || in_array($action$display))) || (!empty($board) && (in_array('allboard'$display) || in_array($board$display))))
return true;

// Ummm, no block!
return false;
}

function 
sp_checkSyntax($code)
{
    return @eval(
'return true;' $code);
}

/*
bool loadDatabaseTables ()
- Preload database Tables this will be only done once per script call
- Return false on error
- Mysql 3.x+ Compatible ;) for SMF 1.1.x
*/
function loadDatabaseTables() {
global $database_tables$db_name;

if(isset($database_tables))
return !empty($database_tables);
else
$database_tables = array();

//Prepare a Checkup ;D
$request db_query("SHOW TABLES FROM `{$db_name}`"__FILE____LINE__);
while ($row mysql_fetch_assoc($request))
$database_tables[] = strtolower(current($row));
mysql_free_result($request);
return !empty($database_tables);
}

/*
bool databaseTableExists (string tablename, bool $addprefix = true)
- Work only in SMF 1.1.x (SMF 2.0.x work diffrent, but it's possible to insert)
- Return true if the tablename exits
- $addprefix will automatic add the $db_prefix (Check also it this is allready done!)
*/
function databaseTableExists($tablename ''$addprefix true) {
global $database_tables$db_prefix;

//Nothing to Serach for ;)
if(empty($tablename))
return false;

//Error ?_?
if(empty($database_tables) && !loadDatabaseTables())
return false;

//First thing i do.. i know normal i should not so this ;P But it's good enouph for smf ;)
$tablename strtolower($tablename);

//Table Prefix auto add? :D
if($addprefix === true && strpos($tablename$db_prefix) !== 0) {
//Looks not so nice ;) but it work trust me ;P
if(strpos($tablename'{$db_prefix}') !== false)
$tablename str_replace('{$db_prefix}'$db_prefix$tablename);
elseif(strpos($tablename'$db_prefix') !== false)
$tablename str_replace('$db_prefix'$db_prefix$tablename);
else
$tablename $db_prefix.$tablename;
}
return in_array($tablename$database_tables);
}

//This function return the correct array that is called.
function sp_loadCalendarData($type$low_date$high_date false) {
global $sourcedir;
static $loaded;
if(!isset($loaded)) {
if(file_exists($sourcedir '/Subs-Calendar.php')) {
require_once($sourcedir '/Subs-Calendar.php');
$loaded['getEvents'] = 'getEventRange';
$loaded['getBirthdays'] = 'getBirthdayRange';
$loaded['getHolidays'] = 'getHolidayRange';
}
else {
require_once($sourcedir '/Calendar.php');
$loaded['getEvents'] = 'calendarEventArray';
$loaded['getBirthdays'] = 'calendarBirthdayArray';
$loaded['getHolidays'] = 'calendarHolidayArray';
}
}
return !empty($loaded[$type]) ? $loaded[$type]($low_date, ($high_date === false $low_date $high_date)) : array();
}

function 
sp_startElement($parser$name$attrs)
{
global $rss_data$rss_current$rss_main;

switch($name)
{
case 'RSS':
case 'RDF:RDF':
case 'ITEMS':
$rss_current '';
break;
case 'CHANNEL':
$rss_main 'CHANNEL';
break;
case 'IMAGE':
$rss_main 'IMAGE';
$rss_data['IMAGE'] = array();
break;
case 'ITEM':
$rss_main 'ITEMS';
break;
default:
$rss_current $name;
break;
}
}

function 
sp_endElement($parser$name)
{
global $rss_data$rss_current$rss_counter;

$rss_current '';

if ($name == 'ITEM')
$rss_counter++;
}

function 
sp_characterData($parser$data)
{
global $rss_data$rss_current$rss_main$rss_counter;

if (!empty($rss_current))
{
switch($rss_main)
{
case 'CHANNEL':
if (isset($rss_data[$rss_current]))
$rss_data[$rss_current] .= $data;
else
$rss_data[$rss_current] = $data;
break;
case 'IMAGE':
if (isset($rss_data[$rss_main][$rss_current]))
$rss_data[$rss_main][$rss_current] .= $data;
else
$rss_data[$rss_main][$rss_current] = $data;
break;
case 'ITEMS':
if (isset($rss_data[$rss_main][$rss_counter][$rss_current]))
$rss_data[$rss_main][$rss_counter][$rss_current] .= $data;
else
$rss_data[$rss_main][$rss_counter][$rss_current] = $data;
break;
}
}
}

?>

Angelina Belle

Two things may have happened here.

You did not have any complaints before you installed SimplePortal? nothing about your database being out of date for SMF 1.1.3?

It seems that the installer failed to make the required changes to the SimplePortal tables.

Can you, skipping your portal page, go to (your forum)/index.php?action=admin

Can you use your "backed-up" files to run a version of your forum files that does not have SimplePortal installed?

Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

w0lfman

No complaints before I attempted the install for SimplePortal.  I updated to 1.1.13 on Friday, I beleive.  I tried to install SImplePortal last night. 

I cant go anywhere other than the screen you see in the attachment in my first post.  Everthing I do takes me back to the error message.

QuoteCan you use your "backed-up" files to run a version of your forum files that does not have SimplePortal installed?
Yes, but I dont know which forum files would that be.

Angelina Belle

Once you revert to your pre-SimplePortal files, you can do an uninstall on SimplePortal (which should fail tests because you've already removed the edits, so it is ok to proceed even though tests failed)
You might as well use the check box remove all the SimplePortal data, while you are at it

After that, I would get install1-1.php out of the zip file and run it to see if it creates the SimplePortal tables properly this time.

This is where you ran into a problem. A simpleportal table did not have every column it should have had, and SMF was extremely unhappy as a result.


In general, you can order files by date, to see which ones were changed most recently.
So, for every file that was changed last night during the SimplePortal install, you will want the corresponding file with the ~ on the end.

Also, for every mod you got from here, you can use the parser to list the files involved in the rewrites:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1104;attach=160883;smf_version=1.1.13
This tells me the files involved are
index.php
SSI.php
Admin.php
BoardIndex.php
Display.php
Help.php
Load.php
ManagePermissions.php
ManageServer.php
QueryString.php
Recent.php
Subs.php
Who.php
index.template.php
Display.template.php





Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

w0lfman

OK, I;ve overwritten the files that you suggested, but now I'm getting this error...

Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

Angelina Belle

That's an odd one. Make sure you have the correct information in settings.php.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

ACAMS

#3851

I have SMF 2.0 RC3 with the RC4 security patch and Simpleportal 2.3.2

I am getting an error in my error log whenever anybody clicks a link to one of my PHP pages, it does not give an error for BBC, or HTML.


http://gametechmods.com/forums/index.php?/page,page2096.html

8: Undefined index: uploadedfile

File: /home/gametechmods/gametechmods.com/forums/Sources/Subs-Portal.php(1155) : eval()'d code
Line: 5



Here is my Subs-Portal.php .....you will see that line 5 has nothing to do with anything.





EDIT: these are uploaders and guests are not allowed, but the error code even pops up for me and other staff and well as regular members.


Here is the real link.. http://gametechmods.com/forums/index.php/page,page2096.html

Angelina Belle

Quote from: ACAMS on April 12, 2011, 08:33:58 PMeval()'d code
That's your clue -- it is happening because of eval'd code, being evaluated in Subs-Portal.php (and therefore, by SimplePortal)
So it must be in one of your custom php blocks or pages -- one that appears at that URL.

Somewhere, you are using an array element ['uploadedfile'], but have not first created that array element. If it is supposed to be in a global variable, you need to start your code-to-be-eval()'d with a global statement declaring that global array.

That should fix it!
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

ACAMS

#3853
I don't understand, can you tell me in simple terms.....yes, I do have uploadedfile in my code
I don't know where to make the statement, or how.


EDIT:
If it goes in my uploader code here is how it starts out.



<?
$target_path = "../Robot_Exchange/AW/"; /// upload folder
$allowedExtentions = "bot"; // allowed extentions
// Upload File
if($_FILES['uploadedfile']['name']){
   $ext = substr($_FILES['uploadedfile']['name'], strrpos($_FILES['uploadedfile']['name'], '.') + 1);
   $chechextentions = explode(",", $allowedExtentions);
   $isallowed = 0;
   foreach($chechextentions as $key => $name){
      if($name==$ext){$isallowed = 1;}
   }



If it needs to go somewhere else, I need to know exactly what and where......I is stuped.

Angelina Belle

You are trying to use $_FILES['uploadedfile']['name'], but $_FILES['uploadedfile'] does not exist.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

ACAMS

Thanks.




Can somebody tell me what I need to do to fix my problem?

Angelina Belle

Where did you get that code from?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

ACAMS

It is some old uploader code a friend wrote years ago that me and another guy have modified over the years to keep it working.
It works fine, just gives the error when I use it in a SimplePortal page. I did not post ALL the code, as I don't want it spread around.

Angelina Belle

This piece of code depends on $_FILES['uploadedfile']['name']) being set. But, in the context of this SimplePortal page, it doesn't appear that the value has been set.

http://www.php.net/manual/en/reserved.variables.files.php
The $_FILES php variable is supposed to be an array of items uploaded to the current script via the HTTP POST method.
But if you are not getting to that page via an HTTP post that uploaded items, then that variable will not have been set.

Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

ALLSTARR

is this compatibel with smf 1.1.13 ?

grtzz

Advertisement: