Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Dynamic Poll

   
Putting poll in ZenCart Goto page 1, 2  Next
View previous topic :: View next topic  
Author Message
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 8:56 am    Post subject: Putting poll in ZenCart

I really need some help. I'd like to put a poll in a sidebox in my Zen-Cart. I've got the sidebox up and ready, but I don't know where to put the code. I'm pretty sure that the code needs to go in /includes/templates/template_default/sideboxes/tpl_program_poll_box.php. This is what is in the php file:

Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: tpl_program_poll.php,v 1.0 2004/02/22 09:30:00 networkdad Exp $
//
 $content = '';

  for ($i=0; $i<sizeof($program_poll); $i++) {
    $content .= $program_poll[$i] . '<br />';
  }

  $content .= '';
?>


The code I need to put in is:

Code:
<?
include("dynamicpoll/poll.php");
?>


I've tried everything I can think of and it doesn't work or gives me an unexpected parse error.

I hope you can give me some direction. If you need any more information, please let me know.

Thanks!!

Cindy
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 561
Location: South East Kentucky,U.S.A.

Posted: Thu Dec 29, 2005 9:43 am    Post subject:

Code:

<?
include 'dynamicpoll/poll.php';
?>

_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 4:32 pm    Post subject:

Thanks for your reply, but I posted that I knew that was the code I needed to put in.

I just need to know WHERE to put it. I listed the php code on the page I think it needs to go in, but I can't figure out where it needs to go.

Thanks in advance!
Back to top
centre
CJ-Design.com Moderator



Joined: 13 Jun 2004
Posts: 150
Location: Canada

Posted: Thu Dec 29, 2005 5:22 pm    Post subject:

Would you mind posting a link to your site if it's online?
_________________
centre
CJ Design Forum Moderator
(Sorry GodFatherUK, I stole your signature)

Also, CJ NewsFlash is in it's first stage of development.

Contact me here
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 5:25 pm    Post subject:

The site is www.DesignItDigital.com and I'd like to put the poll in my sidebox in my zencart at www.DesignItDigital.com/shoppe
Back to top
centre
CJ-Design.com Moderator



Joined: 13 Jun 2004
Posts: 150
Location: Canada

Posted: Thu Dec 29, 2005 5:28 pm    Post subject:

I think you may have posted the wrong file. You said something about the tpl_program_poll_box.php You've posted the tpl_program_poll.php program.
_________________
centre
CJ Design Forum Moderator
(Sorry GodFatherUK, I stole your signature)

Also, CJ NewsFlash is in it's first stage of development.

Contact me here
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 7:09 pm    Post subject:

sorry, this is the right file, but I named it incorrectly in the comment area in the code. Here it is again:

Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: tpl_program_poll_box.php,v 1.0 2004/02/22 09:30:00 networkdad Exp $
//
 $content = '';

  for ($i=0; $i<sizeof($program_poll); $i++) {
    $content .= $program_poll[$i] . '<br />';
  }

  $content .= '';
?>


All files related to sideboxes are as follows:


includes/languages/english/extra_definitions/program_poll_defines.php

Code:
<?php
// $Id: program_poll_defines.php,v 1.0 2004/02/22 09:30:00 networkdad Exp $
//
// Here you can define what your links say
define('BOX_HEADING_EXTRA_LINKS', 'Extra Site Links');

define('BOX_PROGRAM_POLL_1', 'Link 1');
define('BOX_PROGRAM_POLL_2', 'Link 2');
define('BOX_PROGRAM_POLL_3', 'Link 3');
?>


includes/modules/sideboxes/program_poll.php
Code:
<?php
// $Id: program_poll.php,v 1.1 2004/08/22 09:30:00 networkdad Exp $
//

//  internal links within your same domain

//  $program_poll[] = '<a href="' . zen_href_link(FILENAME_PROGRAM_POLL_1) . '">' . BOX_PROGRAM_POLL_1 . '</a>';
//  $program_poll[] = '<a href="' . zen_href_link(FILENAME_PROGRAM_POLL_2) . '">' . BOX_PROGRAM_POLL_2 . '</a>';
//  $program_poll[] = '<a href="' . zen_href_link(FILENAME_PROGRAM_POLL_3) . '">' . BOX_PROGRAM_POLL_3 . '</a>';

//  external links to sites outside of your domain

//  $extra_links[] = '<a href="http://www.somesite1.com">Some Site 1</a>';
//  $extra_links[] = '<a href="http://www.somesite2.com">Some Site 2</a>';
//  $extra_links[] = '<a href="http://www.somesite3.com">Some Site 3</a>';

  require($template->get_template_dir('tpl_program_poll_box.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_program_poll_box.php');

  $title =  "Please Take This Poll";
  $left_corner = false;
  $right_corner = false;
  $right_arrow = false;
  $title_link = false;

  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>


includes/templates/template_default/sideboxes/tpl_program_poll_box.php
Code:
<?php
// $Id: tpl_program_poll_box.php,v 1.0 2004/02/22 09:30:00 networkdad Exp $
//
 $content = '';

  for ($i=0; $i<sizeof($program_poll); $i++) {
    $content .= $program_poll[$i] . '<br />';
  }

  $content .= '';
?>



The code I need to insert somewhere is:

Code:
<?
include 'dynamicpoll/poll.php';
?>


Thanks!


Last edited by cindyjw on Thu Dec 29, 2005 11:37 pm; edited 1 time in total
Back to top
centre
CJ-Design.com Moderator



Joined: 13 Jun 2004
Posts: 150
Location: Canada

Posted: Thu Dec 29, 2005 9:08 pm    Post subject:

Try adding this near the top:

Code:

$program_poll[] = include("dynamicpoll/poll.php");

_________________
centre
CJ Design Forum Moderator
(Sorry GodFatherUK, I stole your signature)

Also, CJ NewsFlash is in it's first stage of development.

Contact me here
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 11:20 pm    Post subject:

I tried that in different places in my tpl_program_poll_box.php file and got the following error:

Warning: main(dynamicpoll/poll.php): failed to open stream: No such file or directory in /home/designit/public_html/shoppe/includes/templates/template_default/sideboxes/tpl_program_poll_box.php on line 22

Warning: main(): Failed opening 'dynamicpoll/poll.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/designit/public_html/shoppe/includes/templates/template_default/sideboxes/tpl_program_poll_box.php on line 22

It seems that I need to put something in
Code:
      $content = ''; 

but I don't know what. All I know is that the dynamicpoll program that I have gives me the following code to put in somewhere:

4) Including the Script

a) The PHP Include Method (.php, .php3, .php4 pages)

To include the script within a PHP web page use the following code:

<?
include("dynamicpoll/poll.php");
?>


Cindy
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1359
Location: Michigan

Posted: Thu Dec 29, 2005 11:29 pm    Post subject:

well looking at this it almost seems like its trying to make its own poll

Code:
$content = '';

  for ($i=0; $i<sizeof($program_poll); $i++) {
    $content .= $program_poll[$i] . '<br />';
  }

  $content .= '';


that looks like its trying to make poll options.
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Thu Dec 29, 2005 11:41 pm    Post subject:

As you can see at http://www.designitdigital.com/shoppe, there is a sidebox on the right side for the poll, but no poll in it.

Based on the information that I have given with the php files related to the sidebox, where do you think I should stick the generated code for the dynamicpoll?

Any ideas?

Cindy
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1359
Location: Michigan

Posted: Thu Dec 29, 2005 11:43 pm    Post subject:

this looks easy.

it says the path is not correct.

place the full path in the include and it should work.
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Fri Dec 30, 2005 4:50 am    Post subject:

I guess what I am asking is:

Can I put

<? include 'dynamicpoll/poll.php';?>

inside a

$content = '';


If not, then how do I use the include? It seems that the content command puts text where I want the poll to go. I don't want text, I want the poll. So how do I ask for the poll in that kind of a statement?

I tried it like this:

Code:
$content = '';
 
  for ($i=0; $i<sizeof($program_poll); $i++) {
    $content .= $program_poll[$i] . '<br />';
  }

  $content .=
  include '/home/designit/public_html/dynamicpoll/poll.php';
  ?>


And I got the poll, but it wasn't in the sidebox. It was above it, and it had a fread error.

Sorry to be such a pain.

Cindy
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1359
Location: Michigan

Posted: Fri Dec 30, 2005 3:31 pm    Post subject:

no you cannot place a include like that.

just placing the include where you want it should make it appear itself.
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
cindyjw
New User


Joined: 29 Dec 2005
Posts: 8
Location: Utah

Posted: Sat Dec 31, 2005 5:04 am    Post subject:

Thank you so much for responding to my questions.

I did find that if I put that include code in my tpl_program_poll.php file (anywhere but in the $content code), that I got the poll to show up, but it wasn't in the outlined box I wanted it in. I found an html poll, and posted that in the $content = ' '; and it showed up in the box and worked.


So, if $content = ' '; won't allow me to put php code in it, is there some other type of wording instead of $content that I can use to put the include code to get the poll in the box?

You can see the html poll in the box at www.designitdigital.com/shoppe. That is where I was hoping to put the dynamicpoll.

If not, then I guess I am out of luck in this instance.

Thanks again for putting up with all my nonsense and helping me to understand what I am doing.

Cindy
Back to top
Display posts from previous:   
       CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Dynamic Poll All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional, Mods by CJ Website Design