PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label themes. Show all posts
Showing posts with label themes. Show all posts

Monday, November 21, 2022

[FIXED] How do I set different colors for local and global variables in Visual Studio?

 November 21, 2022     themes, visual-studio, visual-studio-2017     No comments   

Issue

I've been using monodevelop for a while and was using the 'Monokai' theme. Its coloring was very detailed. As you can see in the screenshot the local and global variables have different colors. Monodevelop colors

Recently I've started using Visual Studio 2017 and can't seem to find a theme that uses different colors for local and global vars.

Visual Studio colors

I've tried going to Tools->Options->Environment->Fonts and colors and couldn't find any setting to individually adjust the text colors of locals and globals. Even though I name these differently, the coloring makes debugging and code reading a bit more easier.

Does anyone know a way to give unique colors to local and global variables?


Solution

I do not believe there is a way to do this within Visual Studio. There may be a 3rd party add-on/extension that may do this.

UPDATE:
Visual Studio 2019, via a software update, recently changed the granularity in which variables can be color 'coded'. Please see Alex's response below for the now correct answer.



Answered By - EL MOJO
Answer Checked By - Cary Denson (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, August 22, 2022

[FIXED] how to change theme in Magento2

 August 22, 2022     admin, magento, magento2, themes     No comments   

Issue

UPDATE: this could be a version issue, should I update to the non-stable 2.0.4?

I know this should seem obvious to someone, but clearly it's not. as state in the documentation

In Admin, go to Stores > Configuration > Design.

but there is only a robot txt edit as seen in the below screen shot

design tab showing only robot .txt editor

I track down the issue on github #4251

All design configurations were moved to Content -> Design -> Configuration

when I get there, my custom theme successfully show up, but no button to change it, as seen below. there is no option to change from the default Luma theme to blank theme neither.

enter image description here

is it just me? or I am blind and missing something really obvious? My Magento version is 2.0.0.


Solution

In newer version of Magento all design related item moved to : Content-> Design -> Configuration -> Edit



Answered By - Himen
Answer Checked By - Timothy Miller (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Thursday, August 4, 2022

[FIXED] How to remove the built-in theme Visual Composer module and install the plugin instead?

 August 04, 2022     php, plugins, themes, visual-composer, wordpress     No comments   

Issue

There is a site on wordpress with theme which is built in the module designer WPBakery Visual Composer. There is a problem with it - some elements have conflict with new version of wordpress, because it is quite outdated. Question: how to undock a built-in designer of the subject and set the Visual Composer plugin. Here is a code for the call in the theme's functions.php designer:

if (!class_exists('WPBakeryVisualComposerAbstract')) {
  $dir = dirname(__FILE__) . '/wpbakery/';
  $composer_settings = Array(
      'APP_ROOT'      => $dir . '/js_composer',
      'WP_ROOT'       => dirname( dirname( dirname( dirname($dir ) ) ) ). '/',
      'APP_DIR'       => basename( $dir ) . '/js_composer/',
      'CONFIG'        => $dir . '/js_composer/config/',
      'ASSETS_DIR'    => 'assets/',
      'COMPOSER'      => $dir . '/js_composer/composer/',
      'COMPOSER_LIB'  => $dir . '/js_composer/composer/lib/',
      'SHORTCODES_LIB'  => $dir . '/js_composer/composer/lib/shortcodes/',
      'USER_DIR_NAME'  => 'extendvc/vc_templates', /* Path relative to your current theme, where VC should look for new shortcode templates */

      //for which content types Visual Composer should be enabled by default
      'default_post_types' => Array('page','post','portfolio_page')
  );
  require_once locate_template('/wpbakery/js_composer/js_composer.php');
  $wpVC_setup->init($composer_settings);
}

// Initialising Shortcodes
if (class_exists('WPBakeryVisualComposerAbstract')) {
  require_once locate_template('/extendvc/extend-vc.php');
}

If I comment these lines and try to install the plugin of Visual Composer, I get the following error:

Fatal error: Cannot redeclare wpb_getImageBySize() (previously declared in /home/likemedi/public_html/wp-content/themes/subway/wpbakery‌​/js_composer/compose‌​r/lib/helpers.php:15‌​) in /home/likemedi/public_html/wp-content/plugins/js_composer/in‌​clude/helpers/helper‌​s.php on line 114


Solution

Try renaming the plugin under wp-content > themes > plugins >.

Just rename the plugin , and reload the admin page.



Answered By - lazy rabbit
Answer Checked By - Terry (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, August 3, 2022

[FIXED] How to show new custom meta box in visual composer in front end

 August 03, 2022     meta-boxes, themes, visual-composer, wordpress     No comments   

Issue

i have create a custom meta box for visual composer and its working fine i admin section

add_action( 'vc_before_init', 'custome_team_section_createWithVC' );


function custome_team_section_createWithVC() {
   vc_map( array(
      "name" => esc_html__( "Custome Team Box", "custome" ),
      "base" => "team_box",
      "category" => "Custome",
      "params" => array( 

        array(
            'type' => 'attach_image',
            'heading' => esc_html__( 'Member Image', 'custome' ),
            'param_name' => 'image_url',
            'description' => esc_html__( 'Add Member Image', 'custome' ),
        ),  

        array(
            "type" => "textfield",
            "heading" => esc_html__("Name", "custome"),
            "param_name" => "name",
            "description" => esc_html__("Add member name.", "custome"),
        "adm    in_label" => true,
        ),    

        array(
            "type" => "textfield",
            "heading" => esc_html__("Job", "custome"),
            "param_name" => "position",
            "description" => esc_html__("Add member position.", "custome"),
        ),

        array(
            "type" => "textarea",
            "heading" => esc_html__("About Member", "custome"),
            "param_name" => "contentm",
            "description" => esc_html__("Add content about the member.", "custome"),
        ),

        array(
            'type' => 'param_group',
            'heading' => esc_html__( 'Social', 'custome' ),
            'param_name' => 'social',
            'value' => urlencode( json_encode( array(
                array(
                    'title' => esc_html__( 'facebook', 'custome' )
                ),
            ) ) ),
            'group' => 'Social',
            'params' => array(
                array(
                    'type' => 'vc_link',
                    'heading' => esc_html__( 'URL (Link)', 'custome' ),
                    'param_name' => 'link',
                    'description' => esc_html__( 'Add a url for social box.', 'custome' ),
                ),  

                array(
                    'type' => 'iconpicker',
                    'heading' => esc_html__( 'Icon', 'custome' ),
                    'param_name' => 'icon_fontawesome',
                    'value' => 'fa fa-info-circle',
                    'settings' => array(
                        'emptyIcon' => false, // default true, display an "EMPTY" icon?
                        'iconsPerPage' => 200, // default 100, how many icons per/page to display
                    ),
                    'description' => esc_html__( 'Select icon from library.', 'custome' ),
                    'admin_label' => true,
                ),

            )
        ),

      ),
   ) );
}

but i dont know how it will show the content in front end i am using the default wordpress theme twenty seventeen and when i check front end after create the page with this meta box its showing the default short codes as showwn in image

enter image description here

what code i have to use in either functions.php or page.php so that it show the custom meta box in front end correctly

Thanks


Solution

Please do not call this a 'custom meta box', that's something else, read here.

You are adding your custom shortcode to the WPBakery Page Builder (formerly Visual Composer) with vc_map(), but you forget to register the shortcode. That's why you're seeing the shortcode on the frontend. The Page Builder is basicly a giant shortcode generator.

The base in the vc_map() function, is used for the shortcode name.

In your case it's team_box.

Add the shortcode like this:

add_shortcode( 'team_box', 'team_box_callback' );
function team_box_callback( $atts ) {
  extract( shortcode_atts( array(
    'image_url' => 'image_url',
    'name' => 'name',
    // add your other field param_name here
  ), $atts ) );

  $your_html_shortcode_output = 'u can now use the shortcode attributes like normal params, like this: ' . $name;

  return $your_html_shortcode_output;
}

You can find more information about vc_map() here.

Regards, Bjorn



Answered By - Bjorn
Answer Checked By - David Goodson (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Thursday, June 30, 2022

[FIXED] How to create presets(theme styles) for shopify theme?

 June 30, 2022     json, liquid, shopify, shopify-template, themes     No comments   

Issue

I'm creating a custom theme by using dawn as reference theme. I want to create 2 presets which changes all the default colors of my header, footer, announcement bar, mobile navbar, sections and the general settings. Now i managed to change the colors of the general settings by setting the preset name and general setting variables in settings_data.json but can't seem to figure out how to change section colors. Tried alot of stuff there but it didn't work. Here's my code

 {
  "current": "Beige",
  "presets": {
    "Beige": {
      "placeholder_color": "#F8E6DA",
      "pagination_tab_bg_color": "#FFF8F2",
      "pagination_number_color": "#000000",
      "pagination_current_page_color": "#F8E6DA",
      "pagination_arrow_tab_color": "#F8E6DA",
      "button_hover": "#EFF6FF",
      "customer_pages_bg_colors": "#ffffff",
      "container_bg_color": "#FFF8F2",
      "border_color": "#F8E6DA",
      "primary_button_color": "#000000",
      "predictive_search_bg_color": "#F8E6DA",
      "predictive_search_button_color": "#FABF9D",
      "predictive_search_button_text_color": "#000000",
      "cart_notify_bg_color": "#FFF8F2",
      "cart_notify_border_color": "#F8E6DA",
      "cart_notify_primary_button_color": "#FABF9D",
      "cart_notify_primary_button_text_color": "#000000",
      "cart_notify_secondary_button_color": "#000000",
      "cart_count_bubble_color": "#303036",
      "gift_card_bg_color": "linear-gradient(#FFF1E8, #EFD1B8)",
      "gift_card_badge_color": "#F8E6DA",
      "gift_card_badge_text_color": "#000000",
      "gift_card_primary_button_color": "#fabf9d",
      "gift_card_secondary_button_color": "#000000",
      "sections": {
        "announcement-bar": {
          "type": "announcement-bar",
          "blocks": {
            "announcement-bar-0": {
              "type": "announcement",
              "settings": {
                "show_announce_home_page": false,
                "text": "Welcome to our store",
                "announce_font_size": 15,
                "announce_text_align": "center",
                "announce_bold": false,
                "link": "",
                "announce_text_color": "#E22120",
                "announce_bg_color": "#ffffff"
              }
            }
          },
          "block_order": [
            "announcement-bar-0"
          ],
          "settings": {
          }
        },
        "mobile-navigation": {
          "type": "mobile-navigation",
          "settings": {
            "nav-menu": "main-menu",
            "mobile_nav_text_color": "#000000",
            "icon_color": "#000000",
            "border_bottom": "#f8e6da",
            "mobile_nav_bg_color": "#ffffff"
          }
        },
        "header": {
          "type": "header",
          "settings": {
            "logo_width": 100,
            "menu": "main-menu",
            "enable_sticky_header": true,
            "show_search_box": true,
            "enable_predictive_search": true,
            "header_text_color": "#000000",
            "icon_color": "#000000",
            "header_bg_color": "#f8e6da",
            "dropdown_hover_color": "#ebd3c3",
            "dropdown_hover_text_color": "#000000"
          }
        },
        "footer": {
          "type": "footer",
          "blocks": {
            "footer-0": {
              "type": "text",
              "settings": {
                "address": "<p>(218) 463-0260 36979 300th St<br\/>Roseau, Minnesota(MN), 56751<\/p>",
                "contact": "<p>+1 (234) 567-89-90 <br\/>+1 (234) 567-89-90<\/p>",
                "email": "info@collector.com"
              }
            },
            "footer-1": {
              "type": "menu",
              "settings": {
                "menu_heading": "Links",
                "menu": "footer",
                "menu_collapse": true
              }
            },
            "88236e16-1b6c-438e-8543-f6fe494e04fb": {
              "type": "menu",
              "settings": {
                "menu_heading": "Quick Links",
                "menu": "footer-menu2",
                "menu_collapse": true
              }
            },
            "footer-2": {
              "type": "info",
              "settings": {
                "additional_info": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis risus mi. Ut placerat quam lectus. Curabitur dictum velit non lacus<\/p>"
              }
            },
            "footer-3": {
              "type": "newsletter",
              "settings": {
                "newsletter_heading": "Subscribe to our emails",
                "newsletter_btn_text": "Sign Up",
                "newsletter_caption": "Phasellus dignissim, tellus in pellentesque mollis, mauris",
                "newsletter_btn_color": "#fabf9d",
                "newsletter_btn_text_color": "#000000"
              }
            }
          },
          "block_order": [
            "footer-0",
            "footer-1",
            "88236e16-1b6c-438e-8543-f6fe494e04fb",
            "footer-2",
            "footer-3"
          ],
          "settings": {
            "footer_logo_width": 100,
            "footer_top_bg_color": "#f8e6da",
            "footer_top_text_color": "#000000",
            "footer_bottom_bg_color": "#303036",
            "footer_bottom_text_color": "#ffffff",
            "show_social": true,
            "payment_enable": true
          }
        }
      },
      "content_for_index": [
  
      ] 
    },
    "Electronic": {
      "placeholder_color": "#7DABE0",
      "pagination_tab_bg_color": "#F8FBFF",
      "pagination_current_page_color": "#EFF6FF",
      "pagination_arrow_tab_color": "#EFF6FF",
      "button_hover": "#EBD3C3",
      "customer_pages_bg_colors": "#FCFEFF",
      "container_bg_color": "#EFF6FF",
      "border_color": "#134074",
      "primary_button_color": "#E0691E",
      "predictive_search_bg_color": "#C6D8ED",
      "predictive_search_button_color": "#E0691E",
      "predictive_search_button_text_color": "#ffffff",
      "cart_notify_bg_color": "#EFF6FF",
      "cart_notify_border_color": "#134074",
      "cart_notify_primary_button_color": "#ED6F1E",
      "cart_notify_primary_button_text_color": "#ffffff",
      "cart_notify_secondary_button_color": "#134074",
      "cart_count_bubble_color": "#ED6F1E",
      "gift_card_bg_color": "linear-gradient(#EFF6FF, #7DABE0)",
      "gift_card_badge_color": "#000000",
      "gift_card_badge_text_color": "#ffffff",
      "gift_card_primary_button_color": "#ED6F1E",
      "gift_card_primary_text_button_color": "#ffffff",
      "gift_card_secondary_button_color": "#134074",
      "sections": {
        "announcement-bar": {
          "type": "announcement-bar",
          "blocks": {
            "announcement-bar-0": {
              "type": "announcement",
              "settings": {
                "show_announce_home_page": false,
                "text": "Welcome to our store",
                "announce_font_size": 15,
                "announce_text_align": "center",
                "announce_bold": false,
                "link": "",
                "announce_text_color": "#E22120",
                "announce_bg_color": "#ffffcf"
              }
            }
          },
          "block_order": [
            "announcement-bar-0"
          ],
          "settings": {
          }
        },
        "mobile-navigation": {
          "type": "mobile-navigation",
          "settings": {
            "nav-menu": "main-menu",
            "mobile_nav_text_color": "#000000",
            "icon_color": "#000000",
            "border_bottom": "#f8e6da",
            "mobile_nav_bg_color": "#fff7f2"
          }
        },
        "header": {
          "type": "header",
          "settings": {
            "logo_width": 100,
            "menu": "main-menu",
            "enable_sticky_header": true,
            "show_search_box": true,
            "enable_predictive_search": true,
            "header_text_color": "#000000",
            "icon_color": "#000000",
            "header_bg_color": "#f8e6da",
            "dropdown_hover_color": "#ebd3c3",
            "dropdown_hover_text_color": "#000000"
          }
        },
        "footer": {
          "type": "footer",
          "blocks": {
            "footer-0": {
              "type": "text",
              "settings": {
                "address": "<p>(218) 463-0260 36979 300th St<br\/>Roseau, Minnesota(MN), 56751<\/p>",
                "contact": "<p>+1 (234) 567-89-90 <br\/>+1 (234) 567-89-90<\/p>",
                "email": "info@collector.com"
              }
            },
            "footer-1": {
              "type": "menu",
              "settings": {
                "menu_heading": "Links",
                "menu": "footer",
                "menu_collapse": true
              }
            },
            "88236e16-1b6c-438e-8543-f6fe494e04fb": {
              "type": "menu",
              "settings": {
                "menu_heading": "Quick Links",
                "menu": "footer-menu2",
                "menu_collapse": true
              }
            },
            "footer-2": {
              "type": "info",
              "settings": {
                "additional_info": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis risus mi. Ut placerat quam lectus. Curabitur dictum velit non lacus<\/p>"
              }
            },
            "footer-3": {
              "type": "newsletter",
              "settings": {
                "newsletter_heading": "Subscribe to our emails",
                "newsletter_btn_text": "Sign Up",
                "newsletter_caption": "Phasellus dignissim, tellus in pellentesque mollis, mauris",
                "newsletter_btn_color": "#fabf9d",
                "newsletter_btn_text_color": "#000000"
              }
            }
          },
          "block_order": [
            "footer-0",
            "footer-1",
            "88236e16-1b6c-438e-8543-f6fe494e04fb",
            "footer-2",
            "footer-3"
          ],
          "settings": {
            "footer_logo_width": 100,
            "footer_top_bg_color": "#f8e6da",
            "footer_top_text_color": "#000000",
            "footer_bottom_bg_color": "#303036",
            "footer_bottom_text_color": "#ffffff",
            "show_social": true,
            "payment_enable": true
          }
        }
      },
      "content_for_index": [
  
      ]
    }
  }
}

The general settings variables work with the change in style but others like announcement bar, mobile-nav, header, footer doesn't work.. my index file is in json format. Is anything here we can do to fix this problem?


Solution

Unfortunately, Shopify presets are just general settings presets, if, for example, you have colors in your sections the only way to create two presets is two create two different sections presets, this solution creates two sections in the section selector in the theme editor for the same section. That's why it's not recommended to add colors to sections and use color schemas instead. (just like in Dawn)



Answered By - Blanklob
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, May 10, 2022

[FIXED] How to add another description block outside the tabs in product detail page

 May 10, 2022     attributes, block, magento2.2, product, themes     No comments   

Issue

I am using Magento 2.2.4. I need to add a block for product detail outside from the main 'Details', 'Review' tabs. I need this block to be separated after the main description of the product. How can I do this? I have started doing this with a custom theme but no idea how to do this.


Solution

Enable Path and block hint from magento admin->configuration->developer->debug then you can see which block is rendering the product review then you can move the block by

<move element="Your_block_name" destination="where_to_move" /> 

dont edit core files ,copy files from vendor->magento->magento catalog to app\design\frontend\your_namespace\your_theme\Magento_Catalog then do the changes in respective files, after change flush,clean cache, reindex and deploy static content



Answered By - Maverik
Answer Checked By - Cary Denson (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Thursday, March 17, 2022

[FIXED] How do I set the default theme in phpMyAdmin?

 March 17, 2022     phpmyadmin, themes     No comments   

Issue

By default the "theme" option in phpMyAdmin affects the theme only for the browser in which the theme setting is changed (stored in a cookie maybe?). How do I set a specific theme as the default for all users?


Solution

A default theme can be specified from the config.inc.php file in the document root of the phpMyAdmin installation:

$cfg['ThemeDefault'] = 'original';

source: http://www.wallpaperama.com/forums/_wxxram.html



Answered By - John Langford
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, February 18, 2022

[FIXED] How to enable a theme for all views?

 February 18, 2022     cakephp, cakephp-3.0, themes     No comments   

Issue

I am working on a CakePHP 3 project and I'm new to CakePHP.

I have baked a theme MyTheme in plugins/MyTheme.

I have also configured default.ctp in plugins/MyTheme/src/Template/Layout/ directory and all css and js files in plugins/MyTheme/webroot/css/ and /plugins/MyTheme/webroot/js/ directories.

How do I enable this theme for all views (master theme) ?


Solution

[...] How do I enable this theme for all views (master theme) ?

By defining the theme to use (either via the $theme property (before CakePHP 3.1), or via the view builders theme() method) in a controller that all your applications controllers extend, which by default should be AppController.

Something along the lines of

//...

class AppController extends Controller
{
    // With CakePHP < 3.1
    public $theme = 'MyTheme';

    // With CakePHP >= 3.1
    public function beforeRender(\Cake\Event\Event $event)
    {
        $this->viewBuilder()->theme('MyTheme');
    }
}

See also

  • Cookbook > Controllers > The App Controller
  • Cookbook > Views > Themes


Answered By - ndm
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Saturday, February 5, 2022

[FIXED] WordPress theme editor is missing

 February 05, 2022     admin, themes, wordpress     No comments   

Issue

I am trying to access the theme editor in WordPress.

The problem is that I cannot find the option under Admin-Appearances - Editor and when I try to access the page using the link http://www.nameofsite.com/wp-admin/theme-editor.php I get the error:

You do not have sufficient permissions to access this page.

I am logged in as an administrator. Why can't I find the editor option?


Solution

It is probably because of iThemes Security and its settings. So yeah, just go to wp-config and change DISALLOW_FILE_EDIT to false.

define( 'DISALLOW_FILE_EDIT', false );

Or just switch it off here: Dashboard -> Security -> WordPress Tweaks -> Configure Settings

Uncheck: Disable File Editor



Answered By - Jirka Štencek
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, January 18, 2022

[FIXED] using composer and autoload in wordpress theme, 'Failed opening required'

 January 18, 2022     composer-php, php, themes, wordpress     No comments   

Issue

So I've installed createsend-php for my theme via composer (I'm trying to learn how too use it) but can't get to the next stage.

I can see the API here - /wp-content/themes/wonkhe2-theme/vendor/campaign-monitor/createsend-php/

composer file seems right to me -

  "require": {
    "php": ">=5.4.0",
    "composer/installers": "~1.0",
    "campaignmonitor/createsend-php": ">=6.0"
  }

in /wp-content/themes/wonkhe2-theme/templates/content-signup-cm.php I've added require_once 'csrest_campaigns.php'

And that returns

Fatal error: require_once(): Failed opening required 'csrest_campaigns.php' (include_path='.:/Applications/MAMP/bin/php/php7.2.7/lib/php') in /wp-content/themes/wonkhe2-theme/templates/content-signup-cm.php on line 5

Should the require_once path be different? I thought autoloader would set the paths and namespaces.

Using composer is new to me so apologies if I'm misunderstanding but any help appreciated.


Solution

you should not require individual classes insalled by composer. instead, right at the start of your code:

require_once 'vendor/autoload.php';

then you can just start using objects;

use Some\Class\Or\Other;

$object = new Other();


Answered By - delboy1978uk
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, January 17, 2022

[FIXED] CakePHP 3.x how to point the templates to a file inside a Plugin?

 January 17, 2022     cakephp, cakephp-3.0, plugins, themes     No comments   

Issue

According to http://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses,

the way to point to a list of template containers, is to create a file inside config folder.

// In a View class
$this->loadHelper('Form', [
    'templates' => 'app_form',
]);

This would load the tags in config/app_form.php. This file should contain an array of templates indexed by name:

How do I do the same by pointing at a file inside a Plugin instead?


Solution

How do I do the same by pointing at a file inside a Plugin instead?

Guess as everywhere else in the framework? Dot notation: PluginName.app_form

If that is not working it should be added to the framework to be consistent.



Answered By - floriank
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Saturday, January 15, 2022

[FIXED] Creating a MAMP Local Copy of a Drupal 6 Website

 January 15, 2022     drupal, drupal-6, mamp, themes     No comments   

Issue

We're currently rebranding a client of ours and it's come the time to take the new brand to their website.
I've not much experience with Drupal other than the theming (I've themed a Drupal website in the past but not very familiar with the software's inner workings).

As this website is live, it's obviously not feasible for me to make any changes to the live environment, so I have downloaded the source files of the website to a local webserver (MAMP).
I also have a MySQL dump of the database.

I'm not sure what files need to be changed inside Drupal to allow access to the MAMP webserver. Could somebody point me in the right direction here?

How would I connect the database to the website, which files need modification?
I think the client is running Drupal 6.

Update:

I've installed the database and linked it up using the below line:

$db_url = 'mysql://root@localhost/databasename';

I've hidden databasename for anonymity.
As it's MAMP, the database has no password. When I load up the website I get an error that install.php is not found. It's not there because the website is already 'installed'.

I've also updated the $base_url to read:

$base_url = 'http://localhost:8888/foldername';

Solution

You only need to modify one file, 'sites/default/settings.php'; you'll just need to change the database connection string in there to match your new database settings. There may be a couple of other settings in there you need to tweak depending on the set up of the site (for example the $base_url or $cookie_domain).

Other than that everything in your installation should be relatively path-ed so there shouldn't be any need to make more changes.



Answered By - Clive
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing