NameSilo

[Resolved] How to change wiki bodytext

Spaceship Spaceship
Watch

newsiness

VIP Member
Impact
49
How to change wiki bodytext

This line print the body text
<?php $this->html('bodytext') ?>

Inside the body text, there is a string called "Consult"
how to change the "Consult" to "hahahaha"

Please advice. Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What are you talking about?
 
0
•••
Can i do something like that?
<?php $this->html('bodytext') = str_replace( "Consult", "hahaha", $this->html('bodytext') ); ?>
 
0
•••
no you could not do that. if doing $this->html('bodytext') echos out the body text then the chances are the method is not returning it in a way that it can be used in a function. You would need to turn output buffering on and capture the output.
 
0
•••
Peter said:
no you could not do that. if doing $this->html('bodytext') echos out the body text then the chances are the method is not returning it in a way that it can be used in a function. You would need to turn output buffering on and capture the output.

peter,

How to turn the output buffering on and capture the output?

Thanks

mholt said:
What are you talking about?

PM you and hopefully you could help to resolve the issue.
 
0
•••
Something like this should work.

PHP:
<?php
function callback($buffer)
{
	return str_replace('Consult', 'hahaha', $buffer);
}

ob_start("callback");
$this->html('bodytext')
ob_end_flush();
?>
 
0
•••
Peter said:
Something like this should work.

PHP:
<?php
function callback($buffer)
{
	return str_replace('Consult', 'hahaha', $buffer);
}

ob_start("callback");
$this->html('bodytext')
ob_end_flush();
?>

I have replaced this <?php $this->html('bodytext') ?> with your code.
Seems not working. Can i replace it this way? :)
 
0
•••
in what way is it not working? also remember str_replace is case sensitive. try replacing something stupid like spaces and see if it works then you know its simply your usage that is wrong.
 
1
•••
Peter said:
in what way is it not working? also remember str_replace is case sensitive. try replacing something stupid like spaces and see if it works then you know its simply your usage that is wrong.

after replacing this code, it returns me a blank page. :)


Update:
with thanks to Peter, it is now resolved..:)
 
Last edited:
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back