GetSimple Support Forum

Full Version: PHP code in PHP code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

<?php echo __(' '$get_page_title' '); ?> but not work..

( I do not know much about the method of eval() )

How can I run?
Thank you!
Try again, I don’t really understand your question. What do you need your code to do?
Hi Zegnåt,

Zegnåt Wrote:Try again, I don’t really understand your question. What do you need your code to do?


<?php echo__(' Zegnåt ')>

Zegnåt: <?php get_page_title(); >

Zegnåt instead of.. I want to write > <?php get_page_title(); >
Use
Code:
<?php return_page_title(); ?>
(you forgot to close php script tag with "?" by the end)

ps. I have no idea about what we are talking in this thread.
yojoe Wrote:<?php return_page_title(); ?>

Hi yojoe,

The script code in this way: <?php echo__(' PAGE TITLE') ?>

Here's the "text" content is turning into another language (eg EN->TR)

But I would like to add the path of the script code <?php get_page_title(); ?>

(unfortunately, my English is not very good)

use: http://codecanyon.net/item/website-trans...view/69435
Code:
<?php echo __(return_page_title()); ?>
return_page_title() gives you the page title as a string. Your __() function wants a string to translate. So the above code should be what you’re looking for.
Zegnåt Wrote:
Code:
<?php echo __(return_page_title()); ?>
return_page_title() gives you the page title as a string. Your __() function wants a string to translate. So the above code should be what you’re looking for.

@yojoe Thank you! Also thank you @Zegnåt

works perfectly;

Code:
<?php echo __(return_page_title()); ?>
return_page_title ok thanks! Does the same apply in get_page_content? :/
Johonwayni Wrote:Does the same apply in get_page_content? :/
No. All get_* functions use “echo” to display content, and you need a string for your function. There is no return_* function for the page content, so you will have to come up with your own solution.

I haven’t tested this, but it should work. Add the following function to your code:
Code:
function return_page_content() {
        global $content;
        $content = stripslashes(htmlspecialchars_decode($content, ENT_QUOTES));
        $content = exec_filter('content',$content);
        return $content;
}
Now you have a way to return the content and you can do this:
Code:
<?php echo __(return_page_content()); ?>
Cool! I worked for this function watches, but did not work Smile .. Your written function works very well. Again thank you so much Zegnåt!