I need to alter some PHP code in McJiffy Easy.
Pages are pulled by keyword. If a text file with the keyword name is in a subdirectory, it adds that text to the page.
So if I have
hxxp://mysite.com/buy/donkey+punches
And I have have a text file, donkey+punches.txt in the text subdirectory, it will add that text to the page.
If no text file exists, nothing will be added.
I want to change the code, so that if a text file with the keyword name DOES NOT exist, it pulls a default text file and inserts that.
I'm thinking I will need to either include another text file, or I could echo text from a variable set in the config.
But where I am stuck is the conditional, I know some smarty, but not php.
Can I use an else?
Help pls?
Pages are pulled by keyword. If a text file with the keyword name is in a subdirectory, it adds that text to the page.
So if I have
hxxp://mysite.com/buy/donkey+punches
And I have have a text file, donkey+punches.txt in the text subdirectory, it will add that text to the page.
If no text file exists, nothing will be added.
I want to change the code, so that if a text file with the keyword name DOES NOT exist, it pulls a default text file and inserts that.
Code:
<?php if (!empty($keywordtext)) {
echo '<div class="keywordtext">' . $keywordtext. '</div>';
} ?>
I'm thinking I will need to either include another text file, or I could echo text from a variable set in the config.
But where I am stuck is the conditional, I know some smarty, but not php.
Can I use an else?
Help pls?
