AJAX/JavaScript/CSS/HTML, Flash Game Development (AS 2.0/AS 3.0), iPhone App Development, Java/PHP/Python/ActionScript and other random techie tidbits I’ve collected
I’ve been trying to get the phpbb3 & zen cart integration to work.
I’ve had some errors in the default SQl zen cart comes with. First I was getting an error about an invalid column name in the phpbb_user_groups table (specifically the group_description column not existing). Once I fixed that, I got a very cryptic “1062 Duplicate entry ” for key 2″ error every time I tried to create a new user.
Here’s how to fix BOTH of these problems:
Problem 1 – “column group_description does not exist”:
Edit line 196 in store>includes>classes>class.phpbb.php. Change “group_description” to “group_desc”
Problem 2 – 1062 Duplicate entry ” for key 2:
Edit line 187 (in the same file as in Problem 1). Change it from:
phpbb requires that each user have a unique “username_clean”. This is the second “key” in the table requirements. The first creates an index on user_id, the second requires username_clean be UNIQUE, the third creates an INDEX on user_birthday, and so on. In fact, at NO POINT do they EVER REQUIRE THE USERNAME TO BE UNIQUE! WHAT????? yep. It’s username_clean that must be unique. zen cart doesn’t even try and insert anything into username_clean, it just tries to make the username (this makes no sense at all!!!).
Feel free to comment if you have any insights/questions!
I’ve been playing with Python this weekend. Currently I’m rebuilding “Clink” in Python instead of finishing it in Flash (It really needs AS 3.0 to do properly, and I only have access to 2.0).
The book I am reading (Game Programming: The L Line, The Express Line to Learning) recommeds the SPE (Stani’s Python Editor) IDE for creating Python programs. However, the book doesn’t really say how to get the program. Stani (the IDE’s author) doesn’t appear to have a web page with a “download” link and instructions; so here’s a download link with instructions from me instead (this is for installing on Windows):
Scroll down and get the version that matches your version of Python. Just double click the downloaded file, and it basically installs itself. I won’t give you any advice on what boxes to check at the end of the install, because I don’t remember what they said, and to be honest, I arbitrarily made my choices having no clue as to why I was choosing what I chose (I unchecked the top one, and left the bottom two checked).
Unzip it to somewhere you will remember (I put mine in Program Files) but don’t rename the folder anything other than “_spe”.
Go inside the _spe directory you just created and double click SPE.py
At this point your shiny new Python IDE should start up. If not, sorry… I don’t know why it didn’t work. Make a shortcut to the editor on your desktop for easy opening (or start menu, or quicklaunch toolbar).
So you want to get Python working with XAMPP eh? Me too! So, apparently, do a lot of people; and pretty much no one who knows how is saying how from what I’ve found online in my cursory 5 minute search. Let’s just jump right in, shall we?
You should have installed XAMPP already, but if you are a brand new “b” to the Server Side Dev ring, and you have stumbled upon this post looking for the catch all solution to getting your feet wet with Server Side Programming and have picked Python as your poison, go get XAMPP! It basically installs and configures itself, and there is an excellent tutorial on the apachefriends website to get you through this process:
You might not have installed Python already (although, if not, why did you choose Python over PHP or Ruby?). If you haven’t installed it already, go download and install it now:
If you are like me, and have a few years worth of stuff in your XAMPP directory that you don’t want to ‘splode when you screw up the first time you try to get Python working with XAMPP, go ahead and just zip c:\xampp to x:\xampp-backup.zip now…
Good question! Check your version of Apache and Python to determine which one you need
Enter the text (leave out the space between phpinfo and ()):
<? phpinfo (); ?>
into a new text document in notepad.
Save the document as “test.php” (or something) in the htdocs directory of your xampp install.
Start Apache (open the xampp control panel, c:\xampp\xampp-control.exe, and click “Start” next to Apache). NOTE: If you have IIS running, stop it. (Control Panel, Administrative Tools, Services, IIS Admin, Stop (say yes to stopping those other services too). If you scroll up to “Apache” at this point and click on it, you will see which version you are running and can skip to the next step in the mod_python install).
Browse to the document you saved in step 2 through your web browser (localhost\test.php). You can NOT just double click the file and expect it to be parsed by apache and run…
Scroll down and view the output in the “apache2handler” section. The first box in the table should be “Apache Version” and should tell you which version of Apache you are running (mine is 2.2.4, so I downloaded the very last “.exe” file so that I would have Python 2.5 w/ Apache 2.2)
Step 3: install mod_python
Double click the exe file
Click “Next”
It should find your Python install. If you have more than one version, select the one you want to use. Click “Next”
Click “Next”
There should be a pop-up asking where Apache is installed. If you installed xampp to c:\, then this will be c:\xampp\apache
Step 4: Configure Apache
Open c:\xampp\apache\conf\httpd.conf
Scroll down to the section with all the “LoadModule” lines (about line #67) and add this line:
LoadModule python_module modules/mod_python.so
Note: If you are unable to start Apache after this, go back and type the line in the conf file by hand instead of copying/pasting.
Scroll down to the section with the <Directory “/xampp/htdocs”> tag ends (about line #232) and add these lines following the closing </Directory> tag:
<Directory "/xampp/htdocs/test">
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>
Save and close the file.
Restart Apache
Create a new file (and folder) c:\xampp\htdocs\test\mptest.py
Place the following text in the file, and save it (watch your formatting, Python is whitespace sensitive!):
You should see “Hello World!”. If you don’t, check this page out (and this one and this one). Also, make sure you got the path correct in the <Directory /> tag, and saved your mptest.py file to the right place.
<Directory /test> … </Directory> <– This is wrong!
But, the following works:
<Directory “C:/xampp/htdocs/test”> … </Directory>
instead on adding the directory block, which turns on mod-python for a single folder, add the following at the end of the file (assumes you want to use the Publisher handler):
<IfModule python_module>
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</IfModule>
If you have any other comments that require code. Just send me an e-mail (cmcculloh-at-gmail-dot-com) and I’ll post the code (so you don’t have to worry about it getting mangled).