News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SimplePortal

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

Previous topic - Next topic

Baloch

During installation of Simple portal latest module getting INTERNAL SERVER ERROR 500

Please advice what to do?

Angelina Belle

I have seen this most frequently when there is a certain type of permission problem. So my advice is to check for and fix this permission problem.  Who is your web host?

If your web hosts uses suphp to make the php engine run with the file permissions YOU have on your file, you may need to use CHMOD to change permissions on directories to 755 and on your files to 644.  Please give that a try to see if it solves the problem.

---------------------
Here is a little more background on the problem:

http://simpleportal.net/index.php?action=docs;area=solving_install_problems
The problem, strangely, has to do with permission settings which are TOO permissive, on certain hosts, because of the way they have chosen to set things up.
In that case, the web server will simply refuse to serve those files with too-permissive settings. and it gives a 500 error.

To fix the problem, you need to REDUCE the permission settings to a point that the webserver will agree to serve them.

Here's the background: Certain hosts have things set up so that the web server and php deal with your files as though they were you.
This is more convenient, for several reasons, than having them work with your files as if they were nobody at all.
And if things are set up correctly, it is just as secure.

But that also means that anybody who is using your website could potentially have permission to mess with your files and directories, if the software would allow them to do so.  SMF uses logins to make sure that only admins can do "admin stuff".  But the webserver and the php engine cannot know that.  So they follow some very simple rules.  If permissions are set dangerously high, they simply refuse to serve those files until the problem is fixed.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

WantSome

Hey guys!  I've posted this on simpleportal.net but I figured I might get a reply here too (and the quicker the better!)

Today I tried to upgrade from 2.3.4 to 2.3.5 but when I pressed install I got a weird error.  I didn't copy the error, sorry.  And I tried a couple of different things but eventually resorted to manually parsing everything with the code on the smf site for parsing. 

Now my forum is not working, throwing out this error: 

QuoteParse error: syntax error, unexpected $end in /public_html/forum/index.php on line 392

Please help?  In the mean time nobody can use my forum!

Shambles

I find that's usually caused by mismatched { } in your source code. Maybe your edit wasn't correctly applied?

Try pushing your index.php to an online php checker service like this one, or dump it here so we can have a ganders

WantSome

Thanks Shambles!

I've dumped it on that checker you recommended - same error: 
QuoteParse error: syntax error, unexpected $end in CODE on line 392 Errors parsing CODE

It highlights line 392 which is the last line and all it contains is ?> (not that I know anything about code, so perhaps it's assuming I know it means some other line :P )

I'm attaching the file here, and would appreciate any advice!

Yes it is possible that I didn't correctly edit the parsing stuff - I did try to be very careful though!

Shambles

I think you need to put a } on line 221

WantSome

oh. my. gawd.  I was so stressed and annoyed with myself and it all resolved with one curly bracket.

I love you with my lover, Shambles, that worked!  You're a hero!

Thank you!!!

Orangine

What would be the best way to detect whether I'm on the [home] page from within a template? I want to hide the menu on my portal home page. I know how to do it for pages or forum (just checking $_GET for 'page'/'forum') but on the portal itself the url doesn't show anything.
Any help appreciated :)

tMicky

Hello,

Is there a way to make the recent topics scrolling?
show avatar, next to recent topics in block?
Have the shoutbox open in a new page and add a button to the shoutbox on the main menu?

Also, don't want a separate homepage, want my board index to be the front page, how do I do that?

thanks

Angelina Belle

@tMicky,
To make recent topics scrolling would require some customization. The php code for the recent topics block would be the place to start
The same with other changes to the recent topics blocks.
For more in-depth discussions of these things, I invite you to simpleportal.net, in the customization board.

You can create a special "shoutbox" page using a page, and display that shoutbox block only on that page.
To add a button to the main menu -- please see navigation buttons mods for simple machines.

If you want your board index to be the front page, you will want "integration mode".
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Angelina Belle

@Orangine,

It seems to me someone has made this request before, and it may be that Suki came up with a simple solution.
There are two usual places to check -- in the URL, and in $context, but for the life of me I cannot remember.

The interesting thing about the portal page URL is that, typically, there is ?action, no topic, board, or ?msg=  on that page.
It is a process of elimination.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Orangine

figured that much @Angelina, using this for the moment:

if (($_GET["page"]=="") && (!empty($_GET)))

tMicky

#4632
Quote from: AngelinaBelle on September 17, 2012, 04:22:29 PM
@tMicky,
To make recent topics scrolling would require some customization. The php code for the recent topics block would be the place to start
The same with other changes to the recent topics blocks.
For more in-depth discussions of these things, I invite you to simpleportal.net, in the customization board.

You can create a special "shoutbox" page using a page, and display that shoutbox block only on that page.
To add a button to the main menu -- please see navigation buttons mods for simple machines.

If you want your board index to be the front page, you will want "integration mode".
Thank you, this is my first time with a portal.

problem 1:
Unfortunately, every time I activate the shoutbox, I get this:
Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation 'ifnull'
File: ./public_html/Sources/Subs-Portal.php
Line: 1251

problem 2:
How Can I remove date and time from showing in Recent Topics Block.

Angelina Belle

The "mix of collations" problem is a database problem.  SimplePortal assumes you will have latin1_general collation on your data tables, and has set up sp_ tables with this collation, but your database actually already had data tables with latin1_swedish collation.

To fix the problem, you need to set the same collation on all the columns of all your tables.  This will take some work in phpmyadmin, or else writing a little script to find and fix all the columns with the "wrong" collation.

Collation, by the way, is related to "dictionary order".  It becomes important when you want to sort things -- order them alphabetically.
MySQL gets confused when you try to match up things that get sorted/ordered differently.

You can remove the date and time from showing in Recent Topics block by changing the code in PortalBlocks.php. This is where the "templates" for all the blocks can be found.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

tMicky

Quote from: AngelinaBelle on September 17, 2012, 07:15:36 PM
The "mix of collations" problem is a database problem.  SimplePortal assumes you will have latin1_general collation on your data tables, and has set up sp_ tables with this collation, but your database actually already had data tables with latin1_swedish collation.

To fix the problem, you need to set the same collation on all the columns of all your tables.  This will take some work in phpmyadmin, or else writing a little script to find and fix all the columns with the "wrong" collation.

Collation, by the way, is related to "dictionary order".  It becomes important when you want to sort things -- order them alphabetically.
MySQL gets confused when you try to match up things that get sorted/ordered differently.

You can remove the date and time from showing in Recent Topics block by changing the code in PortalBlocks.php. This is where the "templates" for all the blocks can be found.
sorry to be a pain, but how do I go about changing the tables. The Simple Portal tables have the latin_swedish info.

Angelina Belle

Hmm.  This sounds all backwards.  There are some scripts available to help fix this kind of problem.
Please confirm some things about your SMF installation
1) This is not a UTF8 installation?
2) Most of your tables are latin_general collation?

Based on this information, I can help you with the right set-up parameters for a general-purpose script that will help you do the job.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Orangine

Ok, it didn't break anything, so I thought I will share it with the world:
http://dev2.theforumguys.com/

tMicky

#4637
Quote from: AngelinaBelle on September 17, 2012, 08:27:42 PM
Hmm.  This sounds all backwards.  There are some scripts available to help fix this kind of problem.
Please confirm some things about your SMF installation
1) This is not a UTF8 installation?
2) Most of your tables are latin_general collation?

Based on this information, I can help you with the right set-up parameters for a general-purpose script that will help you do the job.
Yes, most of the tables are latin_general_ci

Is it possible to have the Recent Topics Sidebar, show only on the board index or have it open on the board index, but collapsed everywhere else.

I already removed it from the admin, profile etc. pages, but it still shows on the topic pages.

thanks.

Angelina Belle

Simple Portal should leave collations alone -- use the default collation for your tables, which should also be the collation used when SMF created your tables in the first place.  But these kinds of changes sometimes happen, anyway.

So here is a general-purpose collation-changing script for MySQL.
1) Back up your entire database before you go any further.  And check to be sure you have got the whole thing. The SMF backup utility times out on some hosts.

2) Fill in the correct information near the top of this script -- some of this information will come from your $Settings file.
3) Fill in the correct collation for your SMF installation I assume this is going to be

$collation = 'latin1_general_ci';
$character_set = 'latin1';

4) Did I mention -- check your database backup?
5) Place the edited script anywhere you can run a php script from, and connect to your database, and point your browser at the correct URL to load that php page
6) remove the script from public access.  It is mostly harmless, but you don't want people randomly touching all your tables.
7) Check to see if the collation problem is solved.

It is absolutely possible to have the Recent Topics block show only on the board index.  Edit that block, and look under Display Options, so you can specify exactly where you want it to show up.


<?
#########################################################################
#########################################################################
##                                                                     ##
## Script coded by Eric Reiche                                         ##
##                                                                     ##
## Version: 0.2 / 2006-08-16 17:35 GMT + 100                           ##
## Version 0.2 contains bugfixes                                       ##
##                                                                     ##
## Inspired by serversupportforum.de user monotek                      ##
## ( http://www.serversupportforum.de/forum/sql/        \              ##
## 9279-kollation-von-tabellen-aendern.html#post67293 )                ##
## [Check link  for bashscript]                                        ##
##                                                                     ##
## Web: http://www.ericreiche.net  ||  Mail: [email protected]  ##
##                                                                     ##
## You can spread this script, until you don't touch this copymark     ##
##                                                                     ##
#########################################################################
#########################################################################


//Config:
  $mysqlserver = 'localhost';    //Host
  $mysqluser = 'username';           //User [It's recomment to use root]
  $mysqlpw = 'password;                 //Password
  $mysqldb = 'db_name';       //Database
  $stepping = 100;               //Queries per Page
  //$tabletoskip = 'really_big_table'; //If you have a really big table, you can enter it here,
                                 //it will be skipped, to prevent a script abort

  $collation = 'latin1_general_ci;
  $character_set = 'latin1';
//End Config

#######################################################################
# Do not change anything from here, until you know what you're doing  #
#######################################################################

if(isset($_GET['start']) && is_numeric($_GET['start'])){
  $start = $_GET['start'];
  if($start > 0){
    $start = $start * $stepping;
  }
}else{
  $start = 0;
}
//mysql connect
@mysql_connect($mysqlserver, $mysqluser, $mysqlpw) OR die("No Conncection to Server. Report: :".mysql_error());
mysql_select_db($mysqldb) OR die("couldn't select database, Report: ".mysql_error());
unset($mysqlserver);
unset($mysqluser);
unset($mysqlpw);

$i = 0;
print('<pre>');
if($start == 0){
  $sql = 'ALTER DATABASE '.$mysqldb.' DEFAULT CHARACTER SET '.$character_set.' COLLATE '.$collation.";\r\n";
  mysql_query($sql);
  print($sql);
}

$sql = 'Show tables;';
$result1 = mysql_query($sql);
while($tables = mysql_fetch_assoc($result1)){
    if($start == 0){
    $sql = 'ALTER TABLE '.$tables['Tables_in_'.$mysqldb].' DEFAULT CHARACTER SET '.$character_set.' COLLATE '.$collation.";\r\n";
    mysql_query($sql);
    print('&nbsp;&nbsp;'.$sql);
  }

  $sql = 'Show columns FROM '.$tables['Tables_in_'.$mysqldb];
  $result2 = mysql_query($sql);

  while($columns = mysql_fetch_assoc($result2)){

    if(substr_count($columns['Type'], 'varchar') || substr_count($columns['Type'], 'text')){
      $i++;
      if($i >= $start && $i < ($start + $stepping)){
        $sql = 'ALTER TABLE '.$tables['Tables_in_'.$mysqldb].' CHANGE '.$columns['Field'].' '.$columns['Field'].' '.$columns['Type'].' CHARACTER SET '.$character_set.' COLLATE '.$collation.';';
        if($tabletoskip != $tables['Tables_in_'.$mysqldb]){
          mysql_query($sql);
          print('&nbsp;&nbsp;&nbsp;&nbsp;'.$i.'. '.$sql."\r\n");
        }else{
          print('&nbsp;&nbsp;&nbsp;&nbsp;'.$i.'. <b>SKIPPED</b>: '.$sql."\r\n");
        }
      }
    }
  }

}
print('</pre>');


  print('<a href="'.$_SERVER['PHP_SELF'].'?start='.($_GET['start'] + 1).'">Weiter...</a>');

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

Angelina Belle

Orangine -- that site looks lovely -- http://dev2.theforumguys.com/
It makes good use of Bloc's new Blocqs theme.

If you are developing that into a "REAL" site (not just a "dev2" site), then I think that one might really deserve to be featured on the
Simple Portal and SMF showcases.

It looks like this is aiming to be a commercial site (ask a dr.).  It is always interesting to see a free forum like SMF used on a commercial site.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Advertisement: