2014-10-08
By: michael
Posted in: Development
What I'd like to do is a series on how to go about solving problems. If you read the forums you will see many instances of questions being asked, then the answer being something like "It's fixed in the next release, so update".
Not all of the code in this series will always be current as better ways of doing things always come up.
What I want to look at here is the base process that you, me or anyone goes through in order to solve a problem.
I'm hoping it will help developers new to Jamroom or new to developing start to get some patterns that they can use to solve their own problems. Which would lead to developing neat stuff.
So here goes:
First thing to remember is:
It's not the problem in particular that we're looking at, but rather the methods we use to solve the problem .
Second thing to remember is:
There is always more than one way to solve a problem .
This problem comes to us from this forum thread:
https://www.jamroom.net/the-jamroom-network/forum/jamroom-developers/14693/in-user-names The issue is: That albums with foreign characters (non English) in the url were causing the album to not display. What we need to figure out is
Why? .
So the steps are:
- figure out where we need to look
- figure out what is not working
- find a way to make it work
- implement that solution.
In this case:
- Where to look was the item_album.tpl file
- What was not working was the wrong thing was being searched for
- To make it work we needed to get the search term into the same format as it was in the database.
- We applied the same code that was used when inserting to the database to the search term.
Fixed.
Nice video Michael!
Wanted to add that for developers, Jamroom has a few functions that are really helpful when it comes to URL encoding and Entity encoding:
jrCore_url_string() - use this in place of urlencode() as it handles a wider variety of languages correctly.
jrCore_entity_string() - use in place of htmlentities(), for the same reason
Cool video!
@b360 Cheers mate. All credit to you for the subject matter. Help me find some other topics too.