by prettyscripts on 2010-03-10 14:37:27 • Leave a comment »
based on the source code (this is V2.4, but it's similar in V3), you need to set correct parameters for $Item->more_link(). the parameters are link_text (defaults to 'Read more') and anchor_text (defaults to 'Follow up').
for most skins this function is called in _item_content.inc.php. if this file does not exist in your skin, copy it from parent directory (do not edit the file from parent directory directly!)
locate $Item->more_link() and edit:
PHP:
$Item->more_link(array( | |
.... // existing code | |
'link_text' => param['more_link_text'], | |
'anchor_text' => param['anchor_text'], // add this | |
)); |
look for files in skin where it includes skin file _item_content.inc.php and add to param:
PHP:
skin_include('_item_content.inc.php', array( | |
.... // existing parameters | |
'more_link_text' => 'text to replace Read more', | |
'anchor_text' => 'text to replace Follow up', | |
)); |
by prettyscripts on 2010-03-09 11:47:53 • Leave a comment »
in the skin, the function call to show author of a post is $Item->author(). by default it links to user page. i wanted to link to user's website. there aren't much information on how to use this function and the doc is outdated.
source code is always the best documentation. the function is defined in inc/items/models/_item.class.php. it seems these are new array parameters introduced in V3.
one of which is link_to. the default is userpage. another available option is userurl - this is what you want.
depends on the skins, locate any files that calls $Item->author() and add 'link_to':
PHP:
$Item->author(array( | |
..... // whatever the current skin uses | |
'link_to' => 'userurl', // add this | |
)); |
the author text now links to website, if defined in user setting in backoffice.
by prettyscripts on 2010-03-08 11:09:13 • Leave a comment »
as of symfony 1.4 and if working with doctrine, there are still problem setting default and correct table encoding and collations with symfony doctrine:build task.
i have previously posted 2 solution. the 1st involves hacking the core code, which needs to be done with every symfony upgrade. the 2nd involves adding options to set default encoding and collation in schema.yml, which has to be done on every table! with the latter, tables created by plugins won't have the correct encoding. you will ended up with a database of tables with mixed collations.
i believe i have found a better solution. add a function to 'config/ProjectConfiguration.class.php':
PHP:
public function configureDoctrine(Doctrine_Manager $manager) { | |
$manager->setCollate('utf8_unicode_ci'); | |
$manager->setCharset('utf8'); | |
} |
by prettyscripts on 2010-03-03 11:43:54 • Leave a comment »
sfDoctrineGuardPlugin provides basic authentication. sf_guard_user table only contains minimal fields to make this feature work. all other user relevant information such as name, birthday, contact numbers etc require a new table sf_guard_user_profile that works with this.
however at the moment user profile setup is poorly documented from the official plugin page.
further information can be found here on how to customize the user profile for frontend and backend. note that this was written for symfony V1.2, some commands maybe be obsoleted and needed to be replaced with newer commands.
here are some main points from the document.
by prettyscripts on 2010-03-02 12:42:43 • 1 comment »
symfony's command line plugin install and uninstall tasks don't work - this could be because the server i'm working on does not have internet connection. so i have to do things manually.