
Originally Posted by
DrByte
Here's how I'd do it:
a) go to the Developers Toolkit in your Admin, under the Tools menu.
b) select the Language Files search, and enter the text you want to search for, ie: "would you like to"
c) that'll bring up a "define" statement in a language file
d) the first half of that define is (in PHP terms) called the "constant", or you might call it the placeholder
e) now do another search, usually in the template files, or in all the php files, for that constant, so you can see exactly where in the PHP code that constant is actually used for output to the browser. That'll be the section of code where you can insert your custom code to display after it.

Originally Posted by
aaronjmorgan
So are you saying I should put the "<?php include("/home/users/web/b2717/ipg.toyzeumcom/store/NewzScript/news.php"); ?>" within the "functions_customer.php" file of the /includes/functions folder... Im not quite sure im following or how to even put the code in the file so that it actually works... if someone can show me exactly how to do it thatd be awesome because my php knowledge is limited. thank you
I'll follow through DrByte's suggestion:
a) Go there
b) The Language Files search is at the top of the screen. I entered would you like to in the "Key or Name" field, used the drop-down box to select "All language files for english" and clicked the associated "Search" button.
c/d) That search brought up the following list, where the "define" TEXT_GREETING_GUEST is what you're looking for:
Code:
C:/xampp/htdocs/zc153/includes/languages/english/gv_send.php
Line #27 : define('TEXT_SEND_ANOTHER', 'Would you like to send another ' . TEXT_GV_NAME . '?');
C:/xampp/htdocs/zc153/includes/languages/english/index.php
Line #14 : define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s">log yourself in</a>?');
Line #19 : define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');
e) Still within Tools->Developers Tool Kit, I entered text_greeting_guest as the "Key or Name" in the "Lookup in All Files" (the search group at the very bottom of the page), selected "All Files - Catalog" from the dropdown list and clicked the associated "Search" button.
f) That search brings up the following file
Code:
C:/xampp/htdocs/zc153/includes/functions/functions_customers.php
Line #142 : $greeting_string = sprintf(TEXT_GREETING_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
g) Since /includes/functions/functions_customers.php is a core file, I don't want to change it if I don't have to. I'll open the file in an editor (like NotePad++), go to line 142 and see that the $greeting_string variable is in the function zen_customer_greeting.
h) Now, I go back to Tools->Developers Tool Kit and enter zen_customer_greeting in the "Key or Name" in the "Lookup in All Files", select "All Files - Catalog" and click the associated "Search" button.
i) That search returns the following files (including the functions_customers.php):
Code:
C:/xampp/htdocs/zc153/includes/functions/functions_customers.php
Line #137 : function zen_customer_greeting() {
C:/xampp/htdocs/zc153/includes/templates/template_default/templates/tpl_index_categories.php
Line #21 : <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
C:/xampp/htdocs/zc153/includes/templates/template_default/templates/tpl_index_default.php
Line #20 : <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
j) Since you indicated that you want the news to appear on your front page, I'd want to edit the tpl_index_default.php (that is your main-page template). If you don't already have a template-override version of tpl_index_default.php, copy the file from /includes/templates/template_default/templates/tpl_index_default.php to /includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php and edit that file, towards the top. I'm "assuming" that /home/users/web/b2717/ipg.toyzeumcom/store/ is your current setting for DIR_FS_CATALOG (present in your configure.php file). Using the constant makes your code more portable, like if you changed hosts or made a test copy of your store):
Code:
<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>
<?php include(DIR_FS_CATALOG . "NewzScript/news.php"); ?>
Whew! That should do it ...