News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SimplePortal

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

Previous topic - Next topic

LC

Quote from: Nathaniel on November 05, 2009, 08:22:48 PM
Okay, so that code doesn't even have 30 lines, I guess it isn't the problem.

The 'eval' message makes it harder to work out where the real issue is, can you disable template eval temporily?

You can 'Disable template eval' via this mod: http://custom.simplemachines.org/mods/index.php?mod=2054

Or you can run this db query:
INSERT INTO smf_settings VALUES ('disableTemplateEval', 1);
I installed the mod and disabled the eval thing. Here are the error codes I get now.

8: Undefined offset: 7
File: /home/site/Sources/PortalBlocks.php(3419) : eval()'d code
Line: 29
   
8: Undefined variable: title
File: /home/site/Sources/PortalBlocks.php(3419) : eval()'d code
Line: 33

Nathaniel

That seems to be an error with a PHP block, although I don't think that its an issue with the code you posted above. Do you have any other PHP blocks?

You can turn the template eval back on.

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

LC

Quote from: Nathaniel on November 05, 2009, 08:48:33 PM
That seems to be an error with a PHP block, although I don't think that its an issue with the code you posted above. Do you have any other PHP blocks?

You can turn the template eval back on.
I have 3 in total. I like that disable eval mod, thanks for finding that.

Here are the other two
$ip = "87.98.159.91";
$port = "9042";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
$title = "The server is offline  ";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode(',', $info);
if (empty($split[6]) )
{
$title = "The current song is not available  ";
}
else
{
$count = count($split);
$i = "6";
while($i<=$count)
{
if ($i > 6)
{
$title .= ", " . $split[$i];
}
else
{
$title .= $split[$i];
}
$i++;
}
}
}
$title = substr($title, 0, -2);
echo $title;


and this one I have had for a while.
global $db_prefix, $scripturl, $memberContext, $color_profile, $txt;

loadLanguage('Profile');

// Ids of users to exclude. (2,3,4)
$exclude_members = array();

$request = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE is_activated = 1" . (!empty($exclude_members) ? "
AND ID_MEMBER NOT IN (" . implode(',', $exclude_members) . ")" : "") . "
ORDER BY RAND()
LIMIT 1", __FILE__, __LINE__);
list ($member) = mysql_fetch_row($request);
mysql_free_result($request);

if (empty($member))
return 'No members.';

loadMemberData($member);
loadMemberContext($member);

$member_info = $memberContext[$member];

if (empty($modSettings['MemberColorLinkInstalled']) && sp_loadColors($member) !== false)
$member_info['colored_link'] = '<strong><a href="' . $scripturl . '?action=profile;u=' . $member_info['id'] . '" title="' . $txt[92] . ' ' . $member_info['name'] . '">' . $color_profile[$member]['colored_name'] . '</a></strong>';

echo '
<div style="text-align: center; width: %99;">';

// Colored member link.
echo '
', $member_info['colored_link'], '<br />';

// Member title.
if (!empty($member_info['title']))
echo '
', $member_info['title'], '<br />';

// Member group.
if (!empty($member_info['group']))
echo '
', $member_info['group'], '<br />';
else
echo '
', $member_info['post_group'], '<br />';

// Group stars.
echo '
', $member_info['group_stars'], '<br />';

// Member avatar.
if (!empty($member_info['avatar']['image']))
echo '
<br />
', $member_info['avatar']['image'], '<br />';

// Personal text.
if (!empty($member_info['blurb']))
echo '
', $member_info['blurb'], '<br />';

// Online image.
echo '
<img src="', $member_info['online']['image_href'], '" alt="', $member_info['online']['text'], '" /> ', $member_info['online']['text'], '<br />';

// Gender name and image.
if (!empty($member_info['gender']['name']))
echo '
', $member_info['gender']['image'], ' ', $member_info['gender']['name'], '<br />';

echo '
<ul style="list-style-type: none; text-align: left; padding: 0px 0px 0px 5px;">';

// Post count.
echo '
<li><strong>', $txt[21], ':</strong> ', $member_info['posts'], '</li>';

// Location.
if (!empty($member_info['location']))
echo '
<li><strong>', $txt[227], ':</strong> ', $member_info['location'], '</li>';

// Date registered.
echo '
<li><strong>', $txt[233], ':</strong> ', $member_info['registered'], '</li>';

// Last login.
echo '
<li><strong>', $txt['lastLoggedIn'], ':</strong> ', $member_info['last_login'], '</li>';

echo '
</ul>
</div>';

Nathaniel

The issues were with the first block, the code below should work:
$ip = "87.98.159.91";
$port = "9042";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
$title = "The server is offline  ";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode(',', $info);
$title = '';
if (empty($split[6]) )
{
$title = "The current song is not available  ";
}
else
{
$count = count($split);
$i = "6";
while($i<$count)
{
if ($i > 6)
{
$title .= ", " . $split[$i];
}
else
{
$title .= $split[$i];
}
$i++;
}
}
}
$title = substr($title, 0, -2);
echo $title;


You needed to define the $title variable, before you use the .= operator on it.

You also had an 'off-by-one' error with the while loop, arrays are indexed starting at the number "0", there isn't an entry at the index "count($array)" but your code was assuming that there was with the '<=' operator, I changed it to the '<' operator.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

LC

Quote from: Nathaniel on November 05, 2009, 09:00:09 PM
The issues were with the first block, the code below should work:
$ip = "87.98.159.91";
$port = "9042";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
$title = "The server is offline  ";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode(',', $info);
$title = '';
if (empty($split[6]) )
{
$title = "The current song is not available  ";
}
else
{
$count = count($split);
$i = "6";
while($i<$count)
{
if ($i > 6)
{
$title .= ", " . $split[$i];
}
else
{
$title .= $split[$i];
}
$i++;
}
}
}
$title = substr($title, 0, -2);
echo $title;


You needed to define the $title variable, before you use the .= operator on it.

You also had an 'off-by-one' error with the while loop, arrays are indexed starting at the number "0", there isn't an entry at the index "count($array)" but your code was assuming that there was with the '<=' operator, I changed it to the '<' operator.
Ah I see. I had assumed it was the other code since it didn't pop up those errors until after I added it. Well that was my goof then, still learning php :). Thank you for helping me with fixing it. It works just fine now.

Livewire1

Hi I installed SP And i have to say how easy it is to setup and configure what you need.

I only wanted it to have a shout box and a couple of adds on my forums then I saw the rss feed.

All very nice.
My problem is though that since i installed it and enabled the intergration I keep getting logged out and refused back in!!
Everytime I click on a link admin or otherwise It kicks me to the login screen!! at one point I could not log in for over an hour, My Members was starting to get annoyed as well as the same was happening to them.
I have managed to disable the SP now and i have not been kicked out again and managed to access all the admin functions without being kicked.. So i can only assume that it is SP doing it.

Thanks

Livewire

Nathaniel

@Livewire1,
What version of SMF are you using?
Did the issue start occuring, straight after you swapped to the 'Integration' mode?
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Livewire1

Thanks for your reply.
I started using it with the charter release version RC2.

I have now uninstalled it while waiting for a reply..

Sorry and yes all my loging in and out problems started when i intergrated SP

Livewire

Nathaniel

Hmm, still unclear about when the errors started appearing. Did they appear as soon as you installed SimplePortal? Or did they start occuring when you changed the 'SP mode' setting to 'Integration'.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Livewire1

The Errors started around the time that i enabled intergration. I had installed SP on a fresh installation RC2 which had upgraded 1.1.10 I was using AdManagment on the last version and read that SP was a better alround way to display a shoutbox and an Ad.

I had the shoutbox running first which at that point did not cause any problems then I setup an Advert with google ads  that worked fine, And i did not notice any errors at that point. Then I noticed an RSS feeder, So I then set that up, all within a few minutes of each other really, The forum started logging me off until a point where it would not allow me access, I eventually managed to get in after around an hour of trying !! it would let me in but oly for a few seconds before logging me out, I Disabled SP and then things were fine UNTIL the last hour where now I have been re logged out and I cannot regain access, I did momentarily but as soon as I click on the admin link it throws me out again.

I hope this is now clear on the chain of events :)

Thank you for your time rerading this.

Livewire

NaWaR

Sinan God Bless you for this mod it's really great looking and very usefull... i dunno if i can post the forum link as a demo link for the mod www.forum.4syr.com  but i just want you to take a look ... no words man to thank you and turkey Our Neighbor Country  ;)

Greets NaWaR

NaWaR

i have a small request please  as update for the portal...

can you make a mobile version for the portal.. so when some one will log in using mobile phone he will get the mobile portal..
it will be as new theme or something like that .. and will appear only the most important information or newest posts or something like that ...

thank you.

Glad to have smf

MultiformeIngegno

Quote from: NaWaR on November 09, 2009, 12:16:58 AM
i have a small request please  as update for the portal...

can you make a mobile version for the portal.. so when some one will log in using mobile phone he will get the mobile portal..
it will be as new theme or something like that .. and will appear only the most important information or newest posts or something like that ...
Yes! I agree!! It would be a nice feature!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Pentaxian

Trying to (re)install  today in 2.0 RC2 I get:
Database error
Unknown column 'content' in 'field list'
File: ..../install2.php
Line: 967

Eliana Tamerin

Are you installing 2.3.1? Or an older version.

Remember that only version 2.3.1 works on RC2 and Curve.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Pentaxian


[SiNaN]

Run this query via phpMyAdmin and try again.

REPLACE INTO smf_settings
VALUES ('sp_version', '2.2.2')
Former SMF Core Developer | My Mods | SimplePortal

Pentaxian

Quote from: [SiNaN] on November 09, 2009, 02:25:38 PM
Run this query via phpMyAdmin and try again.

REPLACE INTO smf_settings
VALUES ('sp_version', '2.2.2')

That's too difficult for me. Sorry.

Is it possible to delete all old-sp files and start anew?

Nathaniel

@Livewire1,
Hmm, SimplePortal doesn't really change any of the functions which deal with logging in/out, so the issue is odd. Does it go away if you uninstall SimplePortal?

@NaWaR,
I suppose that a mobile template would be nice for SimplePortal, although I'm not sure if its something we'll be adding in the near future. There is always theFeature request board over at SimplePortal.net where such requests are less likely to be lost in the torrent of support posts. ;)

@Pentaxian,
Which previous version of SimplePortal did you have installed last?

Try extracting the 'install2.php' file from the SimplePortal 2.3.1 package, then perform this edit to the file.

Code ("Find") Select
global $smcFunc, $db_prefix, $modSettings, $sourcedir, $settings, $db_package_log;

Code ("Replace") Select
global $smcFunc, $db_prefix, $modSettings, $sourcedir, $settings, $db_package_log;
$modSettings['sp_version'] = '2.3.1';

Change the '2.3.1' text to whatever SimplePortal version you last had installed.

Then upload the install2.php file to your forums main directory (where the main 'index.php' file is located), and open it in your browser, the url will be like '{forum url}/install2.php'.

That will update the database, then you should be able to continue with the normal install process.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

MarcusJ

Hello,

I have just upgraded to SMF 2.0 RC2.  I am attempting to install SimplePortal for the first time.  After installing, when it attempts to redirect me to the admin panel I get the following error.


Fatal error: require_once() [function.require]: Failed opening required '/home/******/public_html/archive/Sources/Subs-Portal.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/******/public_html/archive/index.php on line 67

Looking in the directory is shows that the Subs-Portal.php was never copied into place.

Any help or tips here are greatly appreciated.

Thank you.

Advertisement: