mobbbx 1 Report post Posted March 18, 2011 I need help to make the box/soapboxes links to be able to get the language parameter from the url (eg: ?lang=en) in fact, i was hoping that i can put the following code into the box link textbox. < a href="<?php echo qtrans_convertURL('/?lang=en'); ?>" >Link </ a> I looked at the section.boxes.php and saw that sprintf function is used. My guess is that with sprintf function, the box link returns a string, therefore the <?php echo qtrans_convertURL('/?lang=en'); ?> is treated as string. Maybe create a box link media? just like the banners media where i can put the code in. thanks! Share this post Link to post Share on other sites
bryan-hadaway 3 Report post Posted March 18, 2011 I think you might need to have a plugin like Exec-PHP installed: http://wordpress.org/extend/plugins/exec-php/ Thanks, Bryan Share this post Link to post Share on other sites
mobbbx 1 Report post Posted March 18, 2011 I've tried to add another plugin "WP exec PHP" (does not require to disable visual editor) that does allows us to insert php code into posts, pages, widget using [exec][/exec] I manage to successfully insert php code [exec]echo "Hello World" ;[/exec] in the content section of a page. But by inserting the same code into the box (regardless the content section or the box link section), the php code is rendered as text. Thanks! Share this post Link to post Share on other sites
mobbbx 1 Report post Posted March 18, 2011 Just to add, i've also tried exec-php plugin. the results are the same. <?php echo "Hello World" ; ?> works in a regular page content section, but not in the box content section or the box link. Btw i'm using platformbase 1.3.1 thanks! Share this post Link to post Share on other sites
catrina 103 Report post Posted March 18, 2011 Here's another plug-in you might want to try: http://wordpress.org/extend/plugins/shortcode-exec-php/ Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites
mobbbx 1 Report post Posted March 18, 2011 ok. i have accomplished what i wanted by editing the section.boxes.php and section.soapbox.php FYI, i'm making a dual language site, using qtranslate plugin. Everything is good because qtranslate picks up the lang selection, except for the box links or the soapbox links. trying the plugins (exec-php, etc) does not help. so i have to edit the php files directly. For section.boxes.php: FROM-> <div class="fboxtitle"> <h3> <?php if($box_link) printf('%s', $box_link, $bpost->post_title ); else echo do_shortcode($bpost->post_title); ?> </h3> </div>[/code] TO -> [code]<div class="fboxtitle"> <h3> <?php if(qtrans_getLanguage() == "en") if($box_link) printf('%s', $box_link, $bpost->post_title ); else echo do_shortcode($bpost->post_title); else if(qtrans_getLanguage() == "id") if($box_link) printf('%s', $box_link, $bpost->post_title ); else echo do_shortcode($bpost->post_title); ?></h3> I also changed "function _get_box_image" in the section.boxes.php For section.soapbox.php, there's 2 sections to be changed as well. 1 under the "soapbox_link" class and another the "fboxgraphic" class So basically add php if function into the php file. Hope it helps. 1 Share this post Link to post Share on other sites
mobbbx 1 Report post Posted March 18, 2011 I was wondering is there a way to build a custom section or something in platformbase so that the original boxes.php and soapbox.php is not touched while making the links reflect language choices. any advice? Share this post Link to post Share on other sites
kastelic 6 Report post Posted March 18, 2011 Yes you can make your own custom sections that are copied from other sections: http://www.pagelines.com/docs/custom-sections Share this post Link to post Share on other sites