Jump to content



Latest News: (loading..)

* * * * * 1 votes

FAQ system contribution


  • Please log in to reply
72 replies to this topic

#21   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 02:03 AM

View PostSilverado05, on Jul 11 2007, 07:24 AM, said:

I would like to know the same above. I have it installed and working with no errors, but it won't let you delete or edit. Anyone know why or how this works?

-Thanks
See the post 3 above this one. Look at the picture of the faq manager page, See the icons to the right? There is one that looks like a pencil and paper. Click on that to do edits.


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#22   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 02:23 AM

Thanks I have done that though. It doesn't do anything but refresh the page and the little trash can does the same thing.

I have managed to enter what I need to through the DB buy use my phpMyAdmin but can't seem to edit, delete, or insert from the admin side. All those buttons do is just refresh.

-Thanks

Edited by Silverado05, 11 July 2007 - 02:23 AM.

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#23   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 02:29 AM

View PostSilverado05, on Jul 11 2007, 12:23 PM, said:

Thanks I have done that though. It doesn't do anything but refresh the page and the little trash can does the same thing.

I have managed to enter what I need to through the DB buy use my phpMyAdmin but can't seem to edit, delete, or insert from the admin side. All those buttons do is just refresh.

-Thanks
It isn't that the modules aren't updating? See http://forums.oscommerce.com/index.php?sho...mp;#entry923577


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#24   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 03:19 AM

They are not modules it is the actually page from the contribution. If I went to click on the pencil it does nothing, it just refreshes the page and doesn't open up anything to allow you to edit. Does the same thing on the trash can and insert button. It says something in the recent update of the contribution to edit something but doesn't say exactly what to edit.

http://www.oscommerce.com/community/contri...,all/search,FAQ
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#25   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 04:14 AM

View PostSilverado05, on Jul 11 2007, 01:19 PM, said:

They are not modules it is the actually page from the contribution. If I went to click on the pencil it does nothing, it just refreshes the page and doesn't open up anything to allow you to edit. Does the same thing on the trash can and insert button. It says something in the recent update of the contribution to edit something but doesn't say exactly what to edit.

http://www.oscommerce.com/community/contri...,all/search,FAQ
That is to make it php5 compliant. Change all from <? to <?php


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#26   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 04:23 AM

Ah gotcha, I am running php4. Decided not to upgrade to 5.

It would be nice to be able to edit and insert from the admin side. I guess as long as I can manually enter the info through the DB I guess that will work for now.

It's just really weird that those buttons just refresh and don't open anything.


BTW I know why you were not able to checkout on my site the other day. I didn't have the proper zones set but also it has to be within the USA as well.
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#27   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 04:45 AM

View PostSilverado05, on Jul 11 2007, 02:23 PM, said:

Ah gotcha, I am running php4. Decided not to upgrade to 5.

It would be nice to be able to edit and insert from the admin side. I guess as long as I can manually enter the info through the DB I guess that will work for now.

It's just really weird that those buttons just refresh and don't open anything.
BTW I know why you were not able to checkout on my site the other day. I didn't have the proper zones set but also it has to be within the USA as well.
Thanks for letting me know about the checkout problem.

FAQ System should work from the admin without any hassle. I had the trouble you describe on my test site when I did not have the configure.php quite right and I had not done the payment modules fix for osc.
If you want, I can start posting files?


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#28   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 05:15 AM

Yea if you could that would be great.
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#29   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 05:59 AM

View PostSilverado05, on Jul 11 2007, 03:15 PM, said:

Yea if you could that would be great.
admin\faq_manager.php Let me know
<?php
/*
  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
  Originally Created by: [url="http://adgrafics.com"]http://adgrafics.com[/url] admin@adgrafics.net
  Updated by: [url="http://www.webandpepper.ch"]http://www.webandpepper.ch[/url] osc@webandpepper.ch v2.0 (03.03.2004)
  Last Modified: [url="http://shopandgo.caesium55.com"]http://shopandgo.caesium55.com[/url] timmhaas@web.de v2.1 (22.02.2005)
  Released under the GNU General Public License
  osCommerce, Open Source E-Commerce Solutions
  Copyright © 2004 osCommerce
*/

  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/faq.php');
  require(DIR_WS_FUNCTIONS . '/faq.php');

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo FAQ_SYSTEM; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
	<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
	</table></td>
<!-- body_text //-->
	<td width="100%" valign="top">
<table border=0 width="100%">
<?php

switch($faq_action) {

  case "Added":
	$data = browse_faq($language,$HTTP_GET_VARS);
	$no = 1;
	if (sizeof($data) > 0) {
	  while (list($key, $val) = each($data)) {
	  	$no++;
	  }
	};
	$title = FAQ_ADD . ' #' . $no;
	echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=AddSure');
	include('faq_form.php');
  break;

  case "AddSure":
	function add_faq ($data) {
	  $query = "INSERT INTO " . TABLE_FAQ . " VALUES(null, '$data[visible]', '$data[v_order]', '$data[question]', '$data[answer]', NOW(''),'$data[faq_language]')";
	  tep_db_query($query);
	  unset($HTTP_POST_VARS);
	}
	if ($v_order && $answer && $question) {
	  if ((INT)$v_order) {
		add_faq($HTTP_POST_VARS);
		$data = browse_faq($language,$HTTP_GET_VARS);
		$title = FAQ_CREATED . ' ' . FAQ_ADD_QUEUE . ' ' . $v_order;
		include('faq_list.php');
	  } else {
	  	$error = 20;
	  }
	} else {
	  $error = 80;
	}
  break;

  case "Edit":
	if ($faq_id) {
	  $edit = read_data($faq_id);
	  $data = browse_faq($language,$HTTP_GET_VARS);
	  $button = array("Update");
	  $title = FAQ_EDIT_ID . ' ' . $faq_id;
	  echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=Update');
	  echo tep_draw_hidden_field('faq_id', $faq_id);
	  include('faq_form.php');
	} else {
	  $error = 80;
	}
  break;

  case "Update":
	function update_faq ($data) {
	  tep_db_query("UPDATE " . TABLE_FAQ . " SET question='$data[question]', answer='$data[answer]', visible='$data[visible]', v_order=$data[v_order], date = now() WHERE faq_id=$data[faq_id]");
	}
	if ($faq_id && $question && $answer && $v_order) {
	  if ((INT)$v_order) {
		update_faq($HTTP_POST_VARS);
		$data = browse_faq($language,$HTTP_GET_VARS);
		$title = FAQ_UPDATED_ID . ' ' . $faq_id;
		include('faq_list.php');
	  } else {
	  	$error = 20;
	  } 
	} else {
	  $error = 80;
	}
  break;

  case 'Visible':
	function tep_set_faq_visible($faq_id, $HTTP_GET_VARS) {
	  if ($HTTP_GET_VARS['visible'] == 1) {
		return tep_db_query("update " . TABLE_FAQ . " set visible = '0', date = now() where faq_id = '" . $faq_id . "'");
	  } else{
		return tep_db_query("update " . TABLE_FAQ . " set visible = '1', date = now() where faq_id = '" . $faq_id . "'");
	  } 
	}
	tep_set_faq_visible($faq_id, $HTTP_GET_VARS);
	$data = browse_faq($language,$HTTP_GET_VARS);
	if ($HTTP_GET_VARS['visible'] == 1) {
	  $vivod = FAQ_DEACTIVATED_ID;
	} else {
	  $vivod = FAQ_ACTIVATED_ID;
	}
	$title = $vivod . ' ' . $faq_id;
	include('faq_list.php');
  break;

  case "Delete":
	if ($faq_id) {
	  $delete = read_data($faq_id);
	  $data = browse_faq($language,$HTTP_GET_VARS);
	  $title = FAQ_DELETE_CONFITMATION_ID . ' ' . $faq_id;
	  echo '
	  	<tr class="pageHeading"><td>' . $title . '</td></tr>
	  	<tr><td class="dataTableContent"><b>' . FAQ_QUESTION . ':</b></td></tr>
	  	<tr><td class="dataTableContent">' . $delete[question] . '</td></tr>
	  	<tr><td class="dataTableContent"><b>' . FAQ_ANSWER . ':</b></td></tr>
	  	<tr><td class="dataTableContent">' . $delete[answer] . '</td></tr>
	  	<tr><td align="right">
	  ';
	  echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=DelSure&faq_id='.$val[faq_id]);
	  echo tep_draw_hidden_field('faq_id', $faq_id);
	  echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
	  echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
	  echo '</form></td></tr>';
	} else {
	  $error = 80;
	}
  break;


  case "DelSure":
	function delete_faq ($faq_id) {
	  tep_db_query("DELETE FROM " . TABLE_FAQ . " WHERE faq_id=$faq_id");
	}
	if ($faq_id) {
	  delete_faq($faq_id);
	  $data = browse_faq($language,$HTTP_GET_VARS);
	  $title = FAQ_DELETED_ID . ' ' . $faq_id;
	  include('faq_list.php');
	} else {
	  $error = 80;
	}
  break;


  default:
	$data = browse_faq($language,$HTTP_GET_VARS);
	$title = FAQ_MANAGER;
	include('faq_list.php');
  break;
}

if ($error) {
  $content = error_message($error);
  echo $content;
  $data = browse_faq($language,$HTTP_GET_VARS);
  $no = 1;
  if (sizeof($data) > 0) {
  	while (list($key, $val) = each($data)) {
  	  $no++; 
  	}
  };
  $title = FAQ_ADD_QUEUE . ' ' . $no;
  echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=AddSure');
  include('faq_form.php');
}
?>
</table>
</td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>



The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#30   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 06:16 AM

Nope still does it.
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#31   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 06:27 AM

View PostSilverado05, on Jul 11 2007, 04:16 PM, said:

Nope still does it.
OK, admin/includes/functions/faq.php
<?php
/*
  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
  Originally Created by: [url="http://adgrafics.com"]http://adgrafics.com[/url] admin@adgrafics.net
  Updated by: [url="http://www.webandpepper.ch"]http://www.webandpepper.ch[/url] osc@webandpepper.ch v2.0 (03.03.2004)
  Last Modified: [url="http://shopandgo.caesium55.com"]http://shopandgo.caesium55.com[/url] timmhaas@web.de v2.1 (22.02.2005)
  Released under the GNU General Public License
  osCommerce, Open Source E-Commerce Solutions
  Copyright © 2004 osCommerce
*/

  function faq_toc ($language) {
	static $old_faq_id;
	
	if ($old_faq_id) {
	  $exclude = explode("&", $old_faq_id);
	  while (list($dummy,$old_id) = each($exclude)) {
		if ($old_id) {
		  $query .= 'faq_id != ' . $old_id . ' AND ';
		  unset($old_id);
		}
	  }
	}
	$result = tep_db_fetch_array(tep_db_query("SELECT faq_id, question FROM " . TABLE_FAQ . " WHERE $query visible='1' AND language = '$language' ORDER BY v_order asc"));
	if ($result['faq_id']) {
	  $old_faq_id .= $result['faq_id'] . '&';
	  $result['toc'] = '<a href="' . tep_href_link(FILENAME_FAQ_VIEW_ALL,'#' . $result['faq_id']) . '"><b>' . $result['question'] . '</b></a>';
	}
	return $result;
  }

  function read_faq ($language) {
	static $old_faq_id;
	
	if ($old_faq_id) {
	  $exclude = explode("&", $old_faq_id);
	  while (list($dummy,$old_id) = each($exclude)) {
		if ($old_id) {
		  $query .= 'faq_id != ' . $old_id . ' AND ';
		  unset($old_id);
		}
	  }
	}
	$result = tep_db_fetch_array(tep_db_query("SELECT faq_id, question, answer FROM " . TABLE_FAQ . " WHERE $query visible='1' AND language = '$language' ORDER BY v_order asc"));
	if ($result['faq_id']) {
	  $old_faq_id .= $result['faq_id'] . '&';
	  $result['faq'] = '<b><span id="' . $result['faq_id'] . '">' . $result['question'] . '</span></b><br>' . $result['answer'];
	}
	return $result;
  }
  
	function browse_faq ($language,$HTTP_GET_VARS) {
	  if ($HTTP_GET_VARS['faq_lang'] != '') {
	  	$query_lang = "WHERE language = '$HTTP_GET_VARS[faq_lang]'";
	  } elseif ($HTTP_GET_VARS['faq_action'] == 'Added') {
	  	$query_lang = "WHERE language = '$language'";
	  }
	  $query = "SELECT *, DATE_FORMAT(date, '%d.%m.%y') AS d FROM " . TABLE_FAQ . " $query_lang ORDER BY v_order";
	  $daftar = tep_db_query($query);
	  $c=0;
	  while ($buffer = tep_db_fetch_array($daftar)) {
	  	$result[$c] = $buffer;
	  	$c++;
	  }
	  return $result;
	}
	
	function read_data ($faq_id) {
	  $result = tep_db_fetch_array(tep_db_query("SELECT * FROM " . TABLE_FAQ . " WHERE faq_id=$faq_id"));
	  return $result;
	}
	
	function error_message($error) {
	  switch ($error) {
		case "20":
		  return '<tr class=messageStackError><td>' . tep_image(DIR_WS_IMAGES . 'icons/warning.gif', FAQ_WARNING) . ' ' . FAQ_ERROR_20 . '</td></tr>';
		  break;
		case "80":
		  return '<tr class=messageStackError><td>' . tep_image(DIR_WS_IMAGES . 'icons/warning.gif', FAQ_WARNING) . ' ' . FAQ_ERROR_80 . '</td></tr>';
		  break;
		default:
		  return $error;
	  }
	}
  
?>



The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#32   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 06:32 AM

Which version did you use?

If we are using the same version then your files should be the same correct?
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#33   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 06:42 AM

View PostSilverado05, on Jul 11 2007, 04:32 PM, said:

Which version did you use?

If we are using the same version then your files should be the same correct?
2.1 something, I didn't really take much notice of the version. I also can't find my install files because I lost a lot of info when my storage hard disk crashed.
Howver, I do know that mines works on php 4 and 5. There aren't many files involved, and check this:
admin/includes/database_tables.php:
-----------------------------------
// FAQ SYSTEM 2.1

  define('TABLE_FAQ', 'faq');

// FAQ SYSTEM 2.1


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#34   Silverado05

Silverado05
  • Members
  • 1,605 posts
  • Real Name:Nick

Posted 11 July 2007 - 07:58 AM

Yea that is the same version I am using and I just double checked the installation and everything that was suppose to be pasted into those files were there. Not sure why it wont let me edit, delete, or insert new entries.
Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

#35   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 11 July 2007 - 08:31 AM

View PostSilverado05, on Jul 11 2007, 05:58 PM, said:

Yea that is the same version I am using and I just double checked the installation and everything that was suppose to be pasted into those files were there. Not sure why it wont let me edit, delete, or insert new entries.
Very odd. You obviously don't receive error messages.
Does FAQ View and FAQ View All work in Admin?


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#36   MaDeTh

MaDeTh
  • Members
  • 4 posts
  • Real Name:Olwen

Posted 03 August 2007 - 10:16 PM

Hi, I have the exact same problem as Silverado05, I have no errors but I can't edit nor add new FAQs, those buttons just refresh and don't open anything.

#37   robfor

robfor
  • Members
  • 24 posts
  • Real Name:Rob F

Posted 04 September 2007 - 09:53 AM

Hi

I have installed the FAQ System 3.0 constribution and tripple checked that I have done everything the install file says you should do on the admin side but when i click any of the links only a blank page shows up... Inserted som echos in the faq_manager.php file to see where it went wrong and it is when it includes functions/faq.php

  require(DIR_WS_FUNCTIONS . '/faq.php');


it gets stuck. Have compared the 2.x faq.php with the 3.0 one and they are exactly the same, the faq_manager.php files are also the same.

Anyone had a similar problem and knows how to solve it?

/Rob

Edited by robfor, 04 September 2007 - 09:56 AM.


#38   ross2503

ross2503
  • Members
  • 6 posts
  • Real Name:Ross

Posted 24 September 2007 - 12:05 PM

I'm using version 3.0. Installed it from the straight-forward instructions but as above..you click the edit or delete icons in admin and nothing happens, no edit, no delete.

Has anyone solved this yet? Does the admin edit and delete actually work for anyone?

Ross

#39   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 24 September 2007 - 12:34 PM

View Postross2503, on Sep 24 2007, 10:05 PM, said:

I'm using version 3.0. Installed it from the straight-forward instructions but as above..you click the edit or delete icons in admin and nothing happens, no edit, no delete.

Has anyone solved this yet? Does the admin edit and delete actually work for anyone?

Ross
Maybe it is related to the OSC version installed. Don't see what else it can be.


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#40   Burntheweb

Burntheweb
  • Members
  • 53 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Deventer - rock city [NL]

Posted 20 November 2007 - 10:14 AM

just installed the 3.0 version and this is working fine! I really love that contrib!! will be really helpful! Chers for that to the creators!