Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP code in PHP code
#1
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!
Reply
#2
Try again, I don’t really understand your question. What do you need your code to do?
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
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(); >
Reply
#4
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.
Addons: blue business theme, Online Visitors, Notepad
Reply
#5
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
Reply
#6
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#7
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()); ?>
Reply
#8
return_page_title ok thanks! Does the same apply in get_page_content? :/
Reply
#9
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()); ?>
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#10
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!
Reply




Users browsing this thread: 1 Guest(s)