Zen Cart Logo
Forums / All Other Contributions/Addons / Testimonial Manager Support Thread (for ZC v1.5.x)

Testimonial Manager Support Thread (for ZC v1.5.x)

Views: 65,863

Results 161 to 180 of 263
20 Jun 2017, 9:09 PM
#161
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Testimonial Manager Support Thread (for ZC v1.5.x)

davewest:

your most likely thinking you need to add something to languages

// Testimonial manager meta tags
define('META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER_ALL_TESTIMONIALS', 'SOME WORDS ');
define('META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER', 'SOME WORDS ');

> 
> I did to includes/languages/english/YOUR_TEMPLATE/meta_tags.php
> 
> Or none, depending on what common wording you want to have for each post... I use my site name.

Thanks Dave, I didn't really have time to go through it earlier. Should have guessed that really. Long day lol

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

29 Jun 2017, 1:45 PM
#162
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

Hi, I like this plugin. And I installed it. Everything works excepting adding Testimonial.
When I click" add a testimonial", it redirects to "/index.php?main_page=testimonials_add" page. But this page is blank. I checked my logs file. It reads:
PHP Parse error: syntax error, unexpected '=' in /home8/simonhai/public_html/includes/functions/testimonials.php on line 14

Below is the testimonial file

[PHP]<?php
/**
 * Testimonials Manager
 *
 * @package Template System
 * @copyright 2007 Clyde Jones
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: Testimonials_Manager.php v1.5.5e
 */

  function zen_db_insert_id() {
    global $db;
    return = $db->Insert_ID();
  }
//EOF
```\[/PHP]

my site is <https://www.thedancinghair.com>
29 Jun 2017, 1:59 PM
#163
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

kevin_remy:

Hi, I like this plugin. And I installed it. Everything works excepting adding Testimonial.
When I click" add a testimonial", it redirects to "/index.php?main_page=testimonials_add" page. But this page is blank. I checked my logs file. It reads:
PHP Parse error: syntax error, unexpected '=' in /home8/simonhai/public_html/includes/functions/testimonials.php on line 14

Below is the testimonial file

[PHP]<?php
/**

  • Testimonials Manager
  • @package Template System
  • @copyright 2007 Clyde Jones
  • @copyright Portions Copyright 2003-2007 Zen Cart Development Team
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: Testimonials_Manager.php v1.5.5e
    */

function zen_db_insert_id() {
global $db;
return = $db->Insert_ID();
}
//EOF

> 
> my site is <https://www.thedancinghair.com>
Yeah, would remove the = from the line:

return = $db->Insert_ID();

So that it reads:

return $db->Insert_ID();

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 Jun 2017, 2:09 PM
#164
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

The file /includes/functions/testimonials.php was changed in the most recent version of this plugin. Previous versions did not have this problem.

Jim
Wheaton Website Services

29 Jun 2017, 2:16 PM
#165
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

mc12345678:

Yeah, would remove the = from the line:

return = $db->Insert_ID();

> So that it reads:
> ```
 return $db->Insert_ID();

It works. Thank you so much!

29 Jun 2017, 10:27 PM
#166
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

That was a little mistake from me trying to update it to take out all of the mysql_xx functions, I have resubmitted an updated package to correct it


Zen Cart and it's community are the best!!

29 Jun 2017, 11:12 PM
#167
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

lankeeyankee:

That was a little mistake from me trying to update it to take out all of the mysql_xx functions, I have resubmitted an updated package to correct it

No good deed goes unpunished. :smile:

Jim
Wheaton Website Services

30 Jun 2017, 3:30 AM
#168
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

lankeeyankee:

That was a little mistake from me trying to update it to take out all of the mysql_xx functions, I have resubmitted an updated package to correct it

jeking:

No good deed goes unpunished. :smile:
Oops. And I had a part in that too. Sorry. lankeeyankee's update has been published and is available for download

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

30 Jun 2017, 5:37 AM
#169
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

That was one line that never made sense to me!

In the $_POST line 39 ```
$testimonials_id = zen_db_prepare_input($_POST['testimonials_id']);


Then in line 93 ```
 $testimonials_id = zen_db_insert_id();
``` I can understand why we would get it from the database, just not sure why now!  The function is not used anywhere else!

I've commented it out and did away with the function without any issues for some years now.. 

Just wondering why its in the POSTing side of the form.  The Function exists in Admin and works there...  Also thinking maybe there was some mixing of the admin code with the catalog side!

Dave
Always forward thinking... Lost my mind!

30 Jun 2017, 6:52 AM
#170
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

Hey, I still need your help. In all testimonials page, CSS does not work. Check below pic:

Attachment 17115

I added below codes to my template stylesheet.css

.testimonial {
color: #000;
padding: 0 5px 5px 5px;
text-align:left;
}
.testimonial p {
margin: 0; padding: 5px 0;
}
.testimonial span {
float:right;
}
.testimonialImage {
margin: 0;
padding: 0;
text-align: center;
}
30 Jun 2017, 7:15 AM
#171
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

Also, I added metatags code correctly. I think there is something wrong, too. You may check below pic.

Attachment 17116

30 Jun 2017, 2:04 PM
#172
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

kevin_remy:

Hey, I still need your help. In all testimonials page, CSS does not work. Check below pic:

Attachment 17115

I added below codes to my template stylesheet.css

.testimonial {
color: #000;
padding: 0 5px 5px 5px;
text-align:left;
}
.testimonial p {
margin: 0; padding: 5px 0;
}
.testimonial span {
float:right;
}
.testimonialImage {
margin: 0;
padding: 0;
text-align: center;
}


I fixed this problem. Need not reply.
30 Jun 2017, 2:13 PM
#173
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

kevin_remy:

I fixed this problem. Need not reply.

Okay, fixed it, but to help others that may experience the same thing, how was it fixed?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

30 Jun 2017, 10:16 PM
#174
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

mc12345678:

Okay, fixed it, but to help others that may experience the same thing, how was it fixed?

It will work if I did not add these codes to my stylesheet.css

30 Jun 2017, 10:18 PM
#175
kevin_remy avatar

kevin_remy

New Zenner

Join Date:
Mar 2012
Posts:
30
Plugin Contributions:
0

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

mc12345678:

Okay, fixed it, but to help others that may experience the same thing, how was it fixed?

Can you help me with my metatags problem?

30 Jun 2017, 10:45 PM
#176
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

kevin_remy:

Can you help me with my metatags problem?

Same as post 159, was answered in post 160..

Dave
Always forward thinking... Lost my mind!

30 Jun 2017, 10:47 PM
#177
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

davewest:

That was one line that never made sense to me!

In the $_POST line 39 ```
$testimonials_id = zen_db_prepare_input($_POST['testimonials_id']);

> 
> Then in line 93 ```
 $testimonials_id = zen_db_insert_id();
``` I can understand why we would get it from the database, just not sure why now!  The function is not used anywhere else!
> 
> I've commented it out and did away with the function without any issues for some years now.. 
> 
> Just wondering why its in the POSTing side of the form.  The Function exists in Admin and works there...  Also thinking maybe there was some mixing of the admin code with the catalog side!
While not entirely sure of to where you are referring with this, but found "similar" code in the admin file. The way it is used there is to allow putting a testimonial id in the uri by using the bID parameter. When that gets used, data is posted into the form to then when submitted is available for further use/updating. The second, well, ideally such a database insert collection should be performed as close to after the insert as possible to prevent some other database insertion "losing" the record. This is more of an "issue" in newer ZC versions with software that has adopted the use of logging an action because that logging inserts a record though it is not "obvious" by the line of code to do so. :)

So, if you don't use something like ?bID=24 in the uri, the testimonials_id won't be "hidden" on the form and the $_POSTed data won't be fed back to the code.


That clarify things a little?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Jul 2017, 12:00 AM
#178
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

mc12345678:

So, if you don't use something like ?bID=24 in the uri, the testimonials_id won't be "hidden" on the form and the $_POSTed data won't be fed back to the code.

In Admin, it's correct and I do understand its use there, just not from the user input side where the ID is auto generated after the posting of the form data.

So how would one post the id before its auto generated is the question for line 29?

Picking up the ID after its created again, makes sense, but its not in use on the success page as a link nor used in the email sent out, which again would make sense.

Dave
Always forward thinking... Lost my mind!

1 Jul 2017, 1:06 AM
#179
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

davewest:

In Admin, it's correct and I do understand its use there, just not from the user input side where the ID is auto generated after the posting of the form data.

So how would one post the id before its auto generated is the question for line 29?

Picking up the ID after its created again, makes sense, but its not in use on the success page as a link nor used in the email sent out, which again would make sense.

Regarding posting of the testimonials_id "before" it is autogenerated: Here is how I understand the situation, but I think that we are possibly thinking down two different paths.

What seems to be the intended use: Admin knows the testimonials_id that they wish to edit/update, they type in their uri:
/admin/testimonials_manager.php?bID=24.

This takes them to the testimonial that has the id of 24. In so doing this, the action is identified as an update action, a field is populated on the page that contains the testimonials_id (which when the form is submitted will be POSTed) and the other fields to edit are provided. The admin edits the fields, submits the form, this then submits the testimonials_id to support capturing the update. That is where line 29 is involved. It collects the posted data. Then as it continues to process there is a fork in the road of either to insert or update and because this action is considered an update, the existing (POSTed) testimonials_id is used. But, as you may see/notice, the case 'insert' and case 'update' seem to follow the same path. Well, generally speaking an insert and an update both share common actions pretty much up until the end... But... an insert can not (as you have pointed out) already know what the testimonials_id is before it has been "committed". That is why an insert action goes through a collection/autogeneration step. Sure, one could use a web browser to edit the html on the page then submit the page with a testimonials_id and feed that through, but... Towards the end of the "process" because that would be considered an insert (unless that portion of the page was edited also to be an update) a new testimonials_id would be expected and is also controlled that way.

Now, could the code be modified/switched around a little so that there isn't a check to see if it is posted or not? Yeah I can see something like that, but it would/could change the way(s) others have worked with the code. Ie.:

This

      case 'insert':
      case 'update':
        if (isset($_POST['testimonials_id'])) $testimonials_id = zen_db_prepare_input($_POST['testimonials_id']);
        $testimonials_title = zen_db_prepare_input($_POST['testimonials_title']);

could be changed to:

      case 'update':
                  $testimonials_id = zen_db_prepare_input($_POST['testimonials_id']);
      case 'insert':
        $testimonials_title = zen_db_prepare_input($_POST['testimonials_title']);

But then could also ask, why make the change? What problem is solved? Might it prevent similar confusion? Sure, but also how much rework by others is expected to be done? (Helps to know things like that if/when such a thing is done that there be some form of "notification" of doing something from either/both sides. Notice that the overall ZC project does this type of thing by making the new version(s) available for a period of time before committing it for the community to use.

Sorry, I digress I think.. Anyways, hope that explanation helps/helped.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Jul 2017, 5:48 AM
#180
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Testimonial Manager Support Thread (for ZC v1.5.x)

mc12345678:

Regarding posting of the testimonials_id "before" it is autogenerated: Here is how I understand the situation, but I think that we are possibly thinking down two different paths.

We are on two different paths for sure, admin is not the problem at all...

The issue was with the catalog side where the testimonial is created by the user! includes/modules/pages/testimonial_add/header_php.php line 29 is posting from the sent form. However, its not getting inserted and no id getting sent from the form, so it would be blink all the time anyway.

Its just an open door that for me was closed without any problems.

Dave
Always forward thinking... Lost my mind!