How to remove part of a title name using php conversion tool?

I am still a novice with PHP but I feel like I am making this task more complicated then it needs to be.

I recently acquired a tool (dumpHTML) that is coded in php which allows me to convert mediawiki content into html. I have been trying to make minor changes to it so it looks more clean after i convert to html. All the titles of my pages end with " - Docwiki" (Example: “Hole Mounts - Docwiki”) and i do not like that. I want to write something that deletes the " - Docwiki" at the end of every title once i use the conversion tool.

Here is the original code line:

[php]<?php $this->text('pagetitle') ?>[/php]

Here is what I have attempted and i get a fatal error when i try to run the tool:

[php] <?php
$pagetitleA=text(‘pagetitle’);
chop($pagetitleA, " - Docwiki");
?>

<?php $this->$pagetitleA ?> [/php]

I also had a suggestion to try this and it didn’t work:

[php]<?php echo str_replace("- Docwiki",'',$this->text('pagetitle')); ?>[/php]

Is there something I am missing or doing completely wrong? Any help or suggestions will be greatly appreciated!

Yep, all of it!

Ok, let me explain myself.

I spent the last month or so writing a program that allows users to display some content on their site. I did this free of charge by the way and released it to the general public. The only thing I did to give myself a little credit was to add a tiny link in the footer for two reason. 1. bring people to my website to download the software. 2. Let people know it was my baby.

Let’s say I receive an email from someone saying they are using the software and they love it but the footer link is a pain in the backside, any chance of removing it? (legally)
My reply would be “sure, let’s work something out…”

You get the idea?
Point I’m trying to make is that link is there for a reason and is usually added in with a call to an external javascript source - case in point - and PHP will not be able to remove it as it doesn’t exist until after PHP has done it’s job! It would also be morally - and quite possibly - unlawful to remove said link!

Now, having said all that, jquery will do what you want with the correct call at the correct time. :wink:

Good luck with it,
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service