Custom module hoo_menu

im new in drupal 7. I created a custom module in Drupal 7 "audit_pdf" for Extranet. In this module i created a sub-module "audit" who display a custom form. The form is in audit.pages.inc The audit_menu in audit.module

audit.module

[Drupal7.58] Added File Upload as part of a field collection, but it is not working

Like the subject says, i added a file upload within a field collection. However, everytime i uploaded some files (even without any validation), it always give me error. Here are the snipplets of my codes:

function event_register_form_validate($form, &$form_state) {
    $realpath = "";
    if ($wrapper = file_stream_wrapper_get_instance_by_uri('public://')) {
        $realpath = $wrapper->realpath();
    }
    $destination = $realpath . "\\myfiles";
    $file = file_save_upload('file', array(), $destination, FILE_EXISTS_RENAME);

Stop Drupal Sending messages with Google Analytics information?

Drupal is sending e-mails to people with Google Analytics information in the body, the information is also always blank other than the IP.

It looks very cumbersome, is there a way to get rid of it automatically attaching the following information to the bottom of each e-mail/message:

================================================
Google Analytics Information
================================================
Source:
Campaign:
Medium:
Content:
Term:

First Visit:
Previous Visit:
Current Visit:
Times Visited:

How to display phone no in node using token

Hello,

I need to have phone no in node body field. If I have 10 nodes, I need to have the phone no in 10 nodes body field. Instead of hard coding the phone no in all node bodies, I was thinking to have phone no token. 

I guess first I need phone no field in content type. Field key is [field_phoneno].

Edited the field in manage field and have the default phone value as xxx-xxx-xxxx.

Upgrading PHP for Drupal 7

I am rebuilding my website in Drupal 8. My live website is still running on Drupal 7 at the same server.

The databases are running on PHP version 5.6 now. Drupal 8 warns me that Drupal will drop support for this version on March 6, 2019, and advices me to upgrade to PHP version 7.1 or higher.

I could upgrade to PHP 7.0, 7.1 or 7.2 (beta) instead. Since my provider lets me select just one version for all databases (I have two now, one for each website), I want to make sure my D7 website will work with one of these PHP versions.

Show Popover By Default

Hello Drupallers,

This is my first forum post... hope it goes well.   I have the following javascript code that works great all over my website inserted via js injector, but in one instance on the homepage, I need the popover to be displayed on page load. I tried the instructions found here, with no luck. Also, as a javascript novice, the docs found here didn't help either.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x