if someone can help me locate this file id really appreciate it. spending way too much time trying to find it. Thanks!
if someone can help me locate this file id really appreciate it. spending way too much time trying to find it. Thanks!
ive located where the text for that is located the index.php file - but that is not what im looking for-
I want to add this PHP code below it to display a news posting script right below the welcome guest part of the cart, but cannot find the proper place to put the code.... this is the code I need to install- "<?php include("/home/users/web/b2717/ipg.toyzeumcom/store/NewzScript/news.php"); ?> " and im spending way too much time trying to finding where to put this... If someone can help id really appreciate it... Thanks!
ive located where the text for that is located- within the languages/English/ folder- speaking of the index.php file - but that is not what im looking for-
I want to add this PHP code below the portion of code that displays the "welcome guest" and want to display a news posting script right below, but I cannot find the proper file and place to put the code.... this is the code I need to install- "<?php include("/home/users/web/b2717/ipg.toyzeumcom/store/NewzScript/news.php"); ?> " and im spending way too much time trying to finding where to put this... If someone can help id really appreciate it... Thanks!
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.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
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:
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.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>?');
f) That search brings up the following file
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.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'));
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):
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: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>
Whew! That should do it ...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"); ?>
Firstly- thank you for taking the time to try to help me. You are very kind. I did what you said however when I made the change... the entire right hand sidebar is no longer showing... I don't understand what I am doing wrong... Thank you again
When the entire right hand sidebar is no longer showing, you've got a partial whitescreen which implies that you've got a myDEBUG*.log file present in your store's /logs directory (Zen Cart v1.5.0 or later) or /cache directory (for previous versions).
If you look at one of those files, it will contain information that identifies the cause of your partial-whitescreen.
See: http://www.zen-cart.com/content.php?124-blank-page
So if it says - "[28-May-2014 12:23:09] PHP Warning: include(/rootpath/store/Newz/newspage.php) [function.include]: failed to open stream: No such file or directory in /rootpath/store/includes/templates/TOYZEUM/templates/tpl_index_default.php on line 23
[28-May-2014 12:23:09] PHP Warning: include() [function.include]: Failed opening '/rootpath/store/Newz/newspage.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.17/lib/php') in /rootpath/store/includes/templates/TOYZEUM/templates/tpl_index_default.php on line 23
and this is my file listed above
<?php
/**
* Page Template
*
* Main index page<br />
* Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br />
* Centerboxes are called as necessary
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_index_default.php 3464 2006-04-19 00:07:26Z ajeh $
*/
?>
<div class="centerColumn" id="indexDefault">
<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>
<?php include(DIR_FS_CATALOG . "Newz/newstop.php"); ?>
<!-- deprecated - to use uncomment this section
<?php if (TEXT_MAIN) { ?>
<div id="" class="content"><?php echo TEXT_MAIN; ?></div>
<?php } ?>-->
<!-- deprecated - to use uncomment this section
<?php if (TEXT_INFORMATION) { ?>
<div id="" class="content"><?php echo TEXT_INFORMATION; ?></div>
im still confused about what I would need to change in order to get this thing working...
1. The error message tells you exactly what's wrong: "include(/rootpath/store/Newz/newspage.php) [function.include]: failed to open stream: No such file or directory"
To state it another way: your code is telling it to look for /rootpath/store/Newz/newspage.php but that the file doesn't exist on your server. So, you need to put the file onto the server, or fix the code to tell it to look someplace else to find it.
2. Further, while the error talks about "newspage.php", the code you posted from tpl_index_default.php says "newstop.php". You'll need to decide what you're going to call the file, and be consistent.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.