Tag Archives: pma

How to install script on localhost?

For localhost, you can for example (Windows guide):
Install portable XAMPP Version 5.6.3
Create folder in (depends where you install xampp): C:\xampp\htdocs\mywebsite
Extract archive to: C:\xampp\htdocs\mywebsite (Use 7zip, issues are possible with some archivers)
Create empty file: C:\xampp\htdocs\mywebsite\install.txt
Run XAMPP, Apache and MySQL
In browser open phpMyAdmin: http://localhost/phpmyadmin/
Databases->Create new “mywebsite” as attached screen
Run script installation: http://localhost/mywebsite
If you have blank screen issue, try this: http://iwinter.com.hr/support/?p=7819
If no then just enter your wanted details and for database:
DBNAME: “mywebsite”
DBUSER: “root”
DBPASSWORD: LEAVE EMPTY
create-database
EDIT:
We noticed XAMPP >=8.1.6 causing blank screen issue
quickfix solution:
after you extract zip
edit application\config\production\database.php
this change to false:
Screenshot_1

Add field / option manually via phpmyadmin

For WP themes or plugin version:

If you accidentally remove red locked option from the database and now you need it… Now can be added via phpMyAdmin only, SQL queries:

wp_ is database prefix, may be different based on your wp configuration.

80 is field id in such example for badge

INSERT INTO `wp_sw_field` (`idfield`, `parent_id`, `order`, `type`, `is_locked`, `is_table_visible`, `is_preview_visible`, `is_submission_visible`, `is_hardlocked`, `is_required`, `is_translatable`, `is_quickvisible`, `max_length`, `repository_id`, `image_filename`, `image_gallery`, `image_id`, `columns_number`) VALUES (80, NULL, NULL, 'DROPDOWN', '1', NULL, NULL, '1', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

and then:

INSERT INTO `wp_cp_4`.`wp_sw_field_lang` (`idfield_lang`, `field_id`, `lang_id`, `field_name`, `values`, `prefix`, `suffix`, `hint`, `placeholder`) VALUES (NULL, '80', '1', 'Badge', 'b1,b2,b3', NULL, NULL, NULL, NULL);

Then will appear like this:

Screenshot_3

For PHP scripts:

If you accidentally remove red locked option from the database and now you need it… Now can be added via phpMyAdmin only, SQL queries:

To add option:

INSERT INTO `option` (`id` ,`parent_id` ,`order` ,`type` ,`visible` ,`is_locked` ,`is_frontend` ,`is_hardlocked`
) VALUES ('4', '0', NULL , 'DROPDOWN', '1', '1', '1', '1')

To add translations for option:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(4, 1, 'Purpose', 'Sale,Rent,Sale and Rent', NULL, ''),
(4, 2, 'Namjena', 'Prodaja,Najam,Prodaja i najam', NULL, '');

In this example we adding ID #4,  and 1,2 was languages ID.

Another example for translation with just one language:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(8, 1, 'Short description', '', NULL, '');

In this example we adding ID #8,  and 1 was languages ID because now we have only one language.

By ID of course we mean original field ID which you need to restore.

example query for listing category in classified script:

Category have ID field 79, so based on guide add field with id 79 manually, type is TREE
example query:
INSERT INTO `option` (`id` ,`parent_id` ,`order` ,`type` ,`visible` ,`is_locked` ,`is_frontend` ,`is_hardlocked`
) VALUES ('79', '0', NULL , 'TREE', '1', '1', '1', '1')

To add translations for option:

INSERT INTO `option_lang` (`option_id`, `language_id`, `option`, `values`, `prefix`, `suffix`) VALUES
(79, 1, 'Listing Category', '', NULL, '');