Re: Admin Profiles Support Thread
Sorry, for clarity, when I wrote that the problem was within Zen Cart, I didn't mean to inply that there was a problem with Zen Cart, simply that it was Zen Cart which was unable to continue with one of it's database accesses, rather than say, a more general server problem.
Why does it happen? I can't give you a definitive answer because I only joined the Zen Cart community when v1.3 was released and so have very limited experience of the innards of 1.2.7 or ealier (just enough to have done a small number of site upgrades). However, I know that there were some structural changes, some of which will have affected the database structure and in this case it seems likely that Admin Profiles is trying to access a database table or field that exists in v1.3 but didn't (or was named differently) in v1.2.7.
1 Attachment(s)
Re: Admin Profiles Support Thread
I just installed this Admin Profiles. Followed instructions. However, am having problems. Only configuration menu is showing, rest are not.
Please see copy of screen image. How do I fix it?
Re: Admin Profiles Support Thread
Quote:
Originally Posted by makulit
I just installed this Admin Profiles. Followed instructions. However, am having problems. Only configuration menu is showing, rest are not.
Please see copy of screen image. How do I fix it?
This is a problem with your admin/includes/boxes/configuration_dhtml.php file. It has some missing characters that are causing this error. However, curiously, from the little of it that I can see, it doesn't look like the file from Zen Cart v1.3.0, v1.3.0.1 or the one installed as part of Admin Profiles - what version of Zen Cart are you using? Have you made other changes? Please can you post the code from this file (it's not very long)?
Re: Admin Profiles Support Thread
Thanks Kuroi. Below is the copy of the code >>
------------------------------------ code here -------------------
<?php
/**
* @package admin
* @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: configuration_dhtml.php 3009 2006-02-11 15:41:10Z wilt $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
?>
<!-- configuration //-->
<li class="submenu">
<a target="_top" href="<?php echo zen_href_link(FILENAME_ALT_NAV, '', 'NONSSL') ?>"><?php echo BOX_HEADING_CONFIGURATION; ?></a><ul>
<?php
$heading = array();
$contents = array();
$heading[] = array('text' => BOX_HEADING_CONFIGURATION,
'link' => zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('selected_box')) . 'selected_box=configuration'));
if (1 == 1) {
$cfg_groups = '';
$configuration_groups = $db->Execute("select configuration_group_id as cgID,
configuration_group_title as cgTitle
from " . TABLE_CONFIGURATION_GROUP . "
where visible = '1' order by sort_order");
while (!$configuration_groups->EOF) {
$cfg_groups .= '<li><a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $configuration_groups->fields['cgID'], 'NONSSL') . '">' .
$configuration_groups->fields['cgTitle'] . '</a></li>' . "\n";
$configuration_groups->MoveNext();
}
}
echo $cfg_groups;
?>
</ul>
</li>
<!-- configuration_eof //-->/a></li>' . "\n";
$configuration_groups->MoveNext();
echo $cfg_groups;
?>
</ul>
</li>
<!-- configuration_eof //-->
<?php
?>
Re: Admin Profiles Support Thread
As suspected, the your version of the file is corrupt. Either recopy it from the Admin Profiles package, or delete the bits that I've marked in red and add in the bracket that I've marked in magenta (on the penultimate line).
------------------------------------ code here -------------------
<?php
/**
* @package admin
* @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: configuration_dhtml.php 3009 2006-02-11 15:41:10Z wilt $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
?>
<!-- configuration //-->
<li class="submenu">
<a target="_top" href="<?php echo zen_href_link(FILENAME_ALT_NAV, '', 'NONSSL') ?>"><?php echo BOX_HEADING_CONFIGURATION; ?></a><ul>
<?php
$heading = array();
$contents = array();
$heading[] = array('text' => BOX_HEADING_CONFIGURATION,
'link' => zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('selected_box')) . 'selected_box=configuration'));
if (1 == 1) {
$cfg_groups = '';
$configuration_groups = $db->Execute("select configuration_group_id as cgID,
configuration_group_title as cgTitle
from " . TABLE_CONFIGURATION_GROUP . "
where visible = '1' order by sort_order");
while (!$configuration_groups->EOF) {
$cfg_groups .= '<li><a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $configuration_groups->fields['cgID'], 'NONSSL') . '">' .
$configuration_groups->fields['cgTitle'] . '</a></li>' . "\n";
$configuration_groups->MoveNext();
}
}
echo $cfg_groups;
?>
</ul>
</li>
<!-- configuration_eof //-->/a></li>' . "\n";
$configuration_groups->MoveNext();
echo $cfg_groups;
?>
</ul>
</li>
<!-- configuration_eof //-->
<?php
}
?>
1 Attachment(s)
Re: Admin Profiles Support Thread
@kuroi
i recopied the file from admin profiles package. still gave me this ...
Re: Admin Profiles Support Thread
This is clearly going to be a corruption of your customers_dhtml.php file similar to one in your configuarion_dhtml.php file that we fixed before. Is your site on your local machine or a remote server? If it's the latter I would recommend uploading all the Admin Profiles files again and checking your FTP program's error log very carefully to ensure that they have arrived safely.
Re: Admin Profiles Support Thread
Quote:
Originally Posted by kuroi
This is clearly going to be a corruption of your customers_dhtml.php file similar to one in your configuarion_dhtml.php file that we fixed before. Is your site on your local machine or a remote server? If it's the latter I would recommend uploading all the Admin Profiles files again and checking your FTP program's error log very carefully to ensure that they have arrived safely.
thanks kuroi. my site is on a remote server. i followed your suggestion and uploaded all the admin profiles again. this time all files arrived safely and everything's working well. am very happy with the result and this admin is excellent! just what i need. dont want my partners messing with my zen settings
thank you very much!
Re: Admin Profiles Support Thread
Is "updating box files (a step-by-step guide).txt" up to date?
=> question re: found no options array in extra_boxes files.
I'm mid-way through installing Admin Profiles (step 4) & mid-way through the above guide in testing/demo mode install of zen cart.
The one third party contribution I've previously installed is, in fact, Image Handler 2 -- convenient, given your example.
But I find a discrepancy between the instructions & the files discussed.
[ (ZC_Root_Dir)/admin/includes/boxes/extra_boxes/product_music_extras_dhtml.php
& (same_path)/image_handler_tools_dhtml.php).
That being that in neither did I find an $options array as mentioned in step 4 & shown in the example in step 5.
The one & only statement in the IH file was:
Quote:
$za_contents[] = array('text' => BOX_TOOLS_IMAGE_HANDLER, 'link' => zen_href_link(FILENAME_IMAGE_HANDLER, '', 'NONSSL'));
At first I figured that since there is only the one $za_content element there is no need (at present ) for the options array So replacing the 5 assignments from the music_extras w/ the above 1 line will work. As below:
Quote:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$za_contents[] = array('text' => BOX_TOOLS_IMAGE_HANDLER, 'link' => zen_href_link(FILENAME_IMAGE_HANDLER, '', 'NONSSL'));
But looking at the step 5 example I'm guessing that the important part is the
Quote:
if (page_allowed($value['page'])=='true')
test within the foreach loop. Yes? Is this the new part to make AP work? Seems like it would be, but I didn't see such a test nor instructions to add it in the step-by-step.
I'm hoping not only to be corrected if I've missed something, but that by bringing it up here it might help clarify the process for others.
For reference, version ID's:
* @version $Id: product_music_extras_dhtml.php 3001 2006-02-09 21:45:06Z wilt $
* @version $Id: image_handler_tools_dhtml.php,v 1.1 2006/04/11 22:00:55 tim Exp $
For reference, example code from step 5 in step-by-step as I found it:
Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$options = array( array('box' => BOX_TOOLS_IMAGE_HANDLER, 'page' => FILENAME_IMAGE_HANDLER)
);
foreach ($options as $key => $value)
if (page_allowed($value['page'])=='true')
$za_contents[] = array('text' => $value['box'], 'link' => zen_href_link($value['page'], '', 'NONSSL'));
?>
BTW, Kuroi, this looks to be a superb contribution. Kudos to you.
Re: Admin Profiles Support Thread
Hi Chet
You're basically on the right lines, but I thinking you've had a slight glitch alone the way in step 2. To be specific, the product_music_extras_dhtml file that you are quoting from is the default Zen Cart one, not the one that should have replaced it in step 2, that's why it doesn't look like the one described by the updating box files guide.
The image_handler_tools.dhtml file is the one that you're editing and so won't resemble the end result until after your changes.
Many of the well-constructed mods put the files you need in the right hierarchy and you can just drag the top level into your site root directory for everything to be put into the right place. However, I suspect you may have dragged the files individually and my reference to:
Quote:
admin\includes\boxes\*
which is intended to encompass
Quote:
admin\includes\boxes\extra_boxes\product_music_extras_dhtml.php
should probably be a little more explicit to cope with this approach.
Other than that, you're right, the important part is the
Quote:
if (page_allowed($value['page'])=='true')
and an array is a bit OTT for handling a single line, but it made the instructions more straightforward in an area that tends to cause some confusion.
P.S. The choice of Image Handler wasn't a co-incidence. Personally I believe that all Zen Cart users should install it by default, and I suspect that it is the most used add-in.