Remove underscore from page title

ofrpic
ofrpic's picture

Joined: 2014-01-25
Posts: 4
Posted: Sat, 2014-01-25 00:50

I want to remove underscore (_) and hypen(-) from the page title and photo name. Suppose I uploaded an image 'abc_xyz.jpg'. When I view it, the page title shows abc_xyz and photo name at the bottom of the photo also shows the same. Could you please let me know how can I change the title and name to show 'abc xyz' instead of 'abc_xyz'.

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2014-01-25 05:41

Edit photo?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ofrpic
ofrpic's picture

Joined: 2014-01-25
Posts: 4
Posted: Sat, 2014-01-25 19:16

could you please let me know the filename where title is populated?

Cool Photo Gallery || Radio Directory to listen non-stop music

 
ofrpic
ofrpic's picture

Joined: 2014-01-25
Posts: 4
Posted: Sat, 2014-01-25 19:19

I found the solution.. I did the following changes in two files - page.html.php & photo.html.php

page.htmp.php
<? if ($page_title): ?>
<? $to_be_replaced = array('_','-');
$page_title = ucwords(str_replace($to_be_replaced, ' ', $page_title));
echo $page_title;
?>
<? else: ?>
<? if ($theme->item()): ?>
<? $np_title = html::purify($theme->item()->title);
$to_be_replaced = array('_','-');
$np_title = ucwords(str_replace($to_be_replaced, ' ', $np_title));
echo $np_title;
?>

photo.html.php

<div id="g-info">
<h1><? $np_title = html::purify($item->title);
$to_be_replaced = array('_','-');
$np_title = ucwords(str_replace($to_be_replaced, ' ', $np_title));
echo $np_title;
?>
</h1>

changes are here - http://www.ofrpic.in/

Praveen K
---------------------------------
Cool Photo Gallery || Radio Directory to listen non-stop music

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2014-01-25 17:04

Glad you got it sorted and posted what you did for others.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team