Forums / All Other Contributions/Addons / Admin Profiles (for v1.3.x only!) Support Thread

Admin Profiles (for v1.3.x only!) Support Thread

Views: 334,565

Results 21 to 40 of 1,242
19 Jun 2006, 8:36 AM
#21
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Admin Profiles (for v1.3.x only!) 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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

21 Jun 2006, 1:15 AM
#22
makulit avatar

makulit

New Zenner

Join Date:
May 2006
Location:
Japan
Posts:
36
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) 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?

21 Jun 2006, 7:58 AM
#23
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

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)?

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

21 Jun 2006, 1:23 PM
#24
makulit avatar

makulit

New Zenner

Join Date:
May 2006
Location:
Japan
Posts:
36
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) 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 ?>
21 Jun 2006, 1:39 PM
#25
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) 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 } ?>

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

21 Jun 2006, 3:18 PM
#26
makulit avatar

makulit

New Zenner

Join Date:
May 2006
Location:
Japan
Posts:
36
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

@kuroi
i recopied the file from admin profiles package. still gave me this ...

21 Jun 2006, 6:04 PM
#27
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) 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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

22 Jun 2006, 2:00 AM
#28
makulit avatar

makulit

New Zenner

Join Date:
May 2006
Location:
Japan
Posts:
36
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

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!

3 Jul 2006, 9:40 PM
#29
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) 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:> $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:

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
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:
  <?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.

3 Jul 2006, 10:44 PM
#30
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) 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:> admin\includes\boxes*which is intended to encompass> admin\includes\boxes\extra_boxes\product_music_extras_dhtml.phpshould probably be a little more explicit to cope with this approach.

Other than that, you're right, the important part is the> 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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

3 Jul 2006, 11:49 PM
#31
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Yes, I wound up figuring out that I had not uploaded your version of product_music_extras_dhtml. The problem was that I thought I had.

I did understand the "admin\includes\boxes*" as 'everything in the boxes dir'. What happened was that I was going to select all inc. extra_boxes/ but then thought 'well, maybe I should look in here first so I have an idea what if anything I might be clobbering. Unfortunately, I then forgot that I'd done that.

I've actually through a bit of a tale of woe... somewhat comic... but more on that later.
A the moment though, the one overwhelming question in my mind is... what does OTT mean!?
(Especially as I think I should be able to guess.)

Gotta say tho, this is looking really cool...
thx...

3 Jul 2006, 11:53 PM
#32
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

OTT = over the top = more than is necessary

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Jul 2006, 12:09 AM
#33
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

So at this point I've gotten Image Handler & Admin Profiles working on my testing server, installed in that order. Would you suggest doing in the opposite order? If done that way, do you still need to do the updating box files hand edit. No big deal if so, just curious what you think.
thx!
PS, re 'OTT' on the array: hey, it makes sense to me!

4 Jul 2006, 12:22 AM
#34
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Hey, Kuroi, at the risk of being somewhat off-topic, but I think conceptually related, I need to do an extremely simple interface for my "barely know what the web is" users for entering & editing product data -- showing them a bone simple step by step approach. The regular ZC is just way to intimidating for them. Have you seen or done anything like this? Any places to look you know of?

I've looked a bit at the underlying code of category.php & product.php files & it's a bit much. I can dig through extract what the little pieces bit by bit if I have to, but it looks like a real chore... especially as I'm under extreme time pressure (read: supposed to have it already done.)

thx!

4 Jul 2006, 12:29 AM
#35
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

This is where it gets a smidgen more complex. It doesn't really make any difference which way around you install them, as hopefully you will get to same setup either way.

Can you avoid hand coding the box files. Not at the moment. I had some thoughts about that. But to do the full job would mean venturing into the core code, which I really didn't want to do as it would have meant standing by ready to rework the code and/or deal with the user complaints each time Zen Cart had a new release. I also toyed with throwing away all the box files for a single menu or even a database table, so that users could simply the new values and not have to worry about the rest of the hand coding, but I felt that actually deleting files would be a step too far for most users.

The whole Admin function is due for rewrite for version 1.6 of Zen Cart, and it's my hope that the Dev Team will incorporate a proper user access control system at a core level at that time and render Admin Profiles redundant. In the meantime my roadmap for it has just one more functional release which would permit administrators to actually create and save named profiles such as administrator, sales clerk, site designer and then apply a saved profile to a new user.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Jul 2006, 12:33 AM
#36
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

Re; your extremely simple interface. No know of nothing like this. In fact it was the absence of this that led me to take a pre-eixting add-in called Admin Levels and re-cast it as Admin Profiles to try to achieve some simplification in the Admin level for a user that I too was afraid of overwhelming.

I have walked that client through the process of adding categories and products and she did better than I expected. Other developpers have reported that their clients do better with it than you might expect. But I really hope that it's signiuficantly improved in 1.6.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Jul 2006, 1:14 AM
#37
tajul_ashyqin avatar

tajul_ashyqin

Zen Follower

Join Date:
Apr 2006
Location:
Labuan Island
Posts:
362
Plugin Contributions:
1

Re: Admin Profiles (for v1.3.x only!) Support Thread

hi kuroi,

long time i am not spoken to you! ehm, i have a proposition for you...:laugh: is it possible that this current admin profiles mod can control the categories & sub-categories of the products?! :dontgetit it would be a great feature for AP...:yes:

"Whether you think you can, or you think you can't... YOU ARE RIGHT."
GOOD LUCK !!!

4 Jul 2006, 2:39 AM
#38
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Following from #36; Ultra simple interface:
Correct me if I'm wrong-- but the whole ZC override thing doesn't work in the admin area, true?
I just did a test w/ a my_custom1/index.php & it didn't seem to work.

4 Jul 2006, 12:53 PM
#39
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

tajul_ashyqin:

hi kuroi,

long time i am not spoken to you! ehm, i have a proposition for you...:laugh: is it possible that this current admin profiles mod can control the categories & sub-categories of the products?! :dontgetit it would be a great feature for AP...:yes:Sorry Tajul

Admin Profiles currently sits mostly alongside Admin and restricts access to the php files that make up Admin. To do what you suggest would mean starting to go into those files and change them. As there is no override system yet for Admin, this would mean parts of the enlarged Admin Profiles would risk getting wiped out with every release (including bug fix releases) and may even need re-writing for some releases. So it would be a nigthmare for users and and even bigger one for me to support.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Jul 2006, 12:56 PM
#40
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Profiles (for v1.3.x only!) Support Thread

gnotapipe:

Following from #36; Ultra simple interface:
Correct me if I'm wrong-- but the whole ZC override thing doesn't work in the admin area, true?
I just did a test w/ a my_custom1/index.php & it didn't seem to work.You're right. There is no override system for Admin at the moment. You have to overwrite the files that you change. That may change in version 1.6.

BTW. There are two different override systems elsewhere in ZC. Hierarchical for languages and modules, and parallel for templates. This causes mucho confusion until people get there heads around it. I've said more about it in my second post to this thread.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)