my profile preferences
« on: October 20, 2014, 06:27:26 PM »
hi all, i have some how deleted the links that appear when you go into my profile preferences, when i say links i mean they are missing, as in lifestyle etc, i have also deleted all the sections in section management,


does anyone know a quick way to restore the above? thanks,

Re: my profile preferences
« Reply #1 on: October 21, 2014, 08:14:32 PM »
hi all, i have some how deleted the links that appear when you go into my profile preferences, when i say links i mean they are missing, as in lifestyle etc, i have also deleted all the sections in section management,


does anyone know a quick way to restore the above? thanks,

Yes, i know a way:

use phpmyadmin and import from sql file.

I think you have deleted the entries from tables osdate_questions and osdate_questionoptions ?

You find it in file /sql/sample_data.sql, there are entries like

Code: [Select]
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (1, 'Single', 1, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (2, 'Married', 1, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (3, 'Widowed', 1, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10019, 'Black / African', 2, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10020, 'European (white)', 2, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10022, 'Hispanic / Latino', 2, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10005, 'Christian / Other', 3, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (192, '7\' 10"\' (239 cm) or above', 5, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (191, '7\' 9" (236 cm)', 5, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (190, '7\' 8" (234 cm)', 5, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (189, '7\' 7" (231 cm)', 5, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10035, 'A few extra pounds', 6, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10040, 'Large', 6, 'Y');
INSERT INTO `[prefix]_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10033, 'Athletic', 6, 'Y');

and

Code: [Select]
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (1, 'What is your relationship status?', '', '', 'select', 0, 'N', 1, 1, 'Y', 'Marital Status', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (2, 'Which ethnicity describes you best?', NULL, NULL, 'checkbox', 0, 'N', 2, 1, 'Y', 'Ethnicity', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (3, 'What is your faith?', NULL, NULL, 'radio', 0, 'N', 1, 3, 'Y', 'Religion', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (4, 'What do you do for fun?', 'This is where you can describe your activities in more depth. If you like sports, are you a member of any leagues? If you like movies, what genre do you enjoy?', NULL, 'textarea', 250, 'N', 5, 1, 'Y', 'Hobbies', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (5, 'How tall are you?', '', '', 'select', 0, 'N', 2, 2, 'Y', 'Height', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (6, 'Which best describes your body type?', NULL, NULL, 'select', 0, 'N', 2, 5, 'Y', 'Body Type', 'Y','A');
INSERT INTO `[prefix]_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (7, 'What''s your sign?', NULL, NULL, 'select', 0, 'N', 1, 2, 'Y', 'Zodiac Sign', 'Y','A');

Copy the missing entries from sample_data.sql in a new test file using a good editor like notepad2 or notepad++, and then replace "[prefix]" with the table prefix from your config file (normally osdate)

The sample-result after replace is like

Code: [Select]
INSERT INTO `osdate_questions` (`id`, `question`, `description`, `guideline`, `control_type`, `maxlength`, `mandatory`, `section`, `displayorder`, `extsearchable`, `extsearchhead`, `enabled`,`gender`) VALUES (7, 'What''s your sign?', NULL, NULL, 'select', 0, 'N', 1, 2, 'Y', 'Zodiac Sign', 'Y','A');

INSERT INTO `osdate_questionoptions` (`id`, `answer`, `questionid`, `enabled`) VALUES (10712, 'Yes, occasionally', 20, 'Y');


Then import it with phpmyadmin. in case of errors you must truncate the tables befor importing.

But, before you do anything, make a backup from your database and train it, if you aren't familar with phpmyadmin.

With phpmyadmin you can repair something, if you know what you do. If you dont know what you do, you can damage something with phpmyadmin.
« Last Edit: October 21, 2014, 08:20:26 PM by chrissio »
osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!

Re: my profile preferences
« Reply #2 on: October 21, 2014, 08:48:34 PM »
hi, thanks for reply, if i have a backup database can i not take out the following and import?

--
-- Table structure for table `osdate_import_questions_xref`
--

DROP TABLE IF EXISTS `osdate_import_questions_xref`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `osdate_import_questions_xref` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `questionoptionid` int(11) NOT NULL DEFAULT '0',
  `question_text` varchar(255) NOT NULL DEFAULT '',
  `answer_text` varchar(255) NOT NULL DEFAULT '',
  `module` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `questionoptionid` (`questionoptionid`,`module`),
  KEY `question_text` (`question_text`),
  KEY `answer_text` (`answer_text`)
) ENGINE=MyISAM AUTO_INCREMENT=636 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `osdate_import_questions_xref`
--



Re: my profile preferences
« Reply #3 on: October 21, 2014, 08:49:24 PM »
and obviously the rest under it, couldnt fit into a post

Re: my profile preferences
« Reply #4 on: October 21, 2014, 10:06:53 PM »
and obviously the rest under it, couldnt fit into a post

Hi,

sure, if you have a backup of your database, you can take all what you need from backup.

Open backup with a good editor, search for all you miss, and import it with phpmyadmin.

But think about a complete backup of your old database !!! (for restore if you make something wrong ;)

another hint: osdate_import_questions... is database table for imports from other dating scripts!
« Last Edit: October 21, 2014, 10:14:56 PM by chrissio »
osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!