Please help...
I got error when trying modify a php file.
Error:
Parse error: syntax error, unexpected '(', expecting T_STRING in /home/indotux/public_html/olate/includes/url_factory.inc.php on line 24
Code:
PHP Code:
<?php
// include config file
require_once 'config.inc.php';
// prepares a string to be included in an URL
function _prepare_url_text ($string)
{
// remove all characters that aren't a-z, 0-9, dash, underscore or space
$NOT_acceptable_characters_regex = '#[^-a-zA-Z0-9_ ]#';
$string = preg_replace($NOT_acceptable_characters_regex, '', $string);
// remove all leading and trailing spaces
$string = trim($string);
// change all dashes, underscores and spaces to dashes
$string = preg_replace('#[-_ ]+#', '-', $string);
// return the modified string
return $string;
}
// builds a link that contains a category and a product
function (make_category_product_url($file['cat_name'], $file['cat_id'], $file['name'], $file['id']))
{
// prepare the product name and category name for inclusion in URL
$clean_category_name = _prepare_url_text($file['cat_name');
$clean_product_name = _prepare_url_text($file['name']);
// builds a link to a media file
function (make_media_url($id, $name, $extension))
{
// prepare the medium name for inclusion in URL
$clean_name = _prepare_url_text ($name);