Drupal

Drupal is an open-source content-management framework written in PHP used as a back-end framework for websites and is also used for knowledge management and business collaboration. The standard release of Drupal contains basic features common to content management systems, including user account registration and maintenance, menu management, RSS feeds, taxonomy, page layout customization, and system administration. Drupal runs on any computing platform that supports both a Web server capable of running PHP and a database to store content and configuration.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello
I want to display a count of approved users in a Drupal 7 site. I'm using PHP to do this.
I have the following
<?php $members = db_query("SELECT count(uid) FROM {users}")->fetchField(); echo "$members"; ?> 

Open in new window

This is giving me all members, approved or not. How do I show only the members that have been approved for membership?

Thank you
0
Attempting to use the Backup and Migrate module, when I click "Backup now" i just get a white screen.

Best way to diagnose?
0
I created a new Role, and want to limit that Role to only create/edit/delete their own content, limited to some new Content Types I crreated for that role.

The new Role may view other content, but not edit.

I was using the Permission page, but don't see options to get my specific requirements.
0
Hi,

I help support a site for a local figure skating club, we want to add a members only section that requires a login and has content that can be seen only by logging in.

We have meeting information, forms and other such information that we want to share only with club members.  I have looked as much as I can find on Drupalgardens but I cannot seem to get just what I want.  Has anyone here done this?  I have seen on DrupalGardens many people asking about this, but no clear instructions on how to do it.

Any suggestions would be greatly appreciated.  

Thanks.
0
I'm looking for case studies, resources, videos, any other resources for demonstrating integration of AngularJS and  Drupal.
0
Hello,
I have a Drupal7 site that has Filedepot installed. When users (non site administrators of the site) go to the www.example.com/filedepot/ page, they get an "Access Denied" message. They can go to the Organic Group folder that is listed on the left side, but not the root of FileDepot.
According to the permissions page of the directory in Filedepot, "Annonymous users" have "View rights", but still sees the Denied massage. Even when they are part of "Group A membership", that has full rights ( all boxes checked) they still do not have access to the folder and still sees the "Access Denied" when going to the root of Filedepot.


They are able to "Add Content", but are unable to see the document when looking at there user profile.

I'm really at a loss on this one. Any help would be great.

Thank you,
Abe
0
I want to allow myself a pass-thru to the Drupal login page.

Login page is at /user and my IP is the 69.

Here's part of the code. When i run it, I just get white page.

$ref = $_SERVER["HTTP_REFERER"];
if(!$user->uid) {
		$ip = $_SERVER['REMOTE_ADDR'] == 69.143.164.204)
		header ("https://navigator-dev.cap.gsa.gov/user");
		} else {
				if ($ref != 'https://hallways-dev.fas.gsa.gov/hallways/ITHardware')
				{
					drupal_goto("https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");
					exit();
				}else {
				$username=base64_decode($_GET['c']);
				if($username) {
				$myaccount = cas_user_load_by_name($username);
				if ($myaccount) {
				$user = user_load( $myaccount->uid);
					}
				}	
				}
			}
	}

Open in new window

0
On our website, we use the CAS Module to athenticate.

But I need to put in a redirect to pass the visitors to another site first.

But the CAS challenge seems to kick before the redirect takes effect.

How can I bypass?

// rev. 10-06-2014, 10AM
// This code redirects Visitor to Hallways' Welcome page.
// Visitor will authenticate into OMB MAX via Hallways, then get a pass-thru to Navigator site.
// Navigator, because of the CAS Module, will accept the incoming authentication, 
// so the User will already be signed in to OMB MAX when they land on Navigator home page.

<?php
$ref = $_SERVER["HTTP_REFERER"];
if ( $ref == 'https://hallways-dev.fas.gsa.gov/hallways/navtest' )
{
		if (isset($_SESSION['phpCAS']['attributes']['samlAuthenticationStatementAuthMethod'])) {
		 echo "you came from hallways -- defined - you are authenticated in cas - stay here";
		} else {
		echo "you came from hallways -- but -- not defined in cas";
		//header("Location:https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");
		//exit;
		}
}
else
{
header("Location:https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");

}
?>

Open in new window

0
Here is what I'm using to 1) redirect users to Hallways' Welcome.html page.

2) They can only come via Hallway's navtest page.

The issue I'm having is once the user is on Navigator, clicking on any link seems to start the redirect again, and they're being sent to Hallways yet again.  Best way to resolve?

// rev. 10-06-2014, 10AM
// This code redirects Visitor to Hallways' Welcome page.
// Visitor will authenticate into OMB MAX via Hallways, then get a pass-thru to Navigator site.
// Navigator, because of the CAS Module, will accept the incoming authentication, 
// so the User will already be signed in to OMB MAX when they land on Navigator home page.

<?php
$ref = $_SERVER["HTTP_REFERER"];
if ( $ref == 'https://hallways-dev.fas.gsa.gov/hallways/navtest' )
{
		if (isset($_SESSION['phpCAS']['attributes']['samlAuthenticationStatementAuthMethod'])) {
		 echo "you came from hallways -- defined - you are authenticated in cas - stay here";
		} else {
		echo "you came from hallways -- but -- not defined in cas";
		//header("Location:https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");
		//exit;
		}
}
else
{
header("Location:https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");

}
?>

Open in new window

0
I have a one-page Drupal site,  https;//mydrupalsitecom/

I only want to allow visitors from https://www.thissite.com/custompage

Any other visitors should be redirected to https://www.thissite.com/

Best in .htacesss or does this need some custom PHP coding to put into Drupal?
0
After removing the Admin Menu module via the Linux terminal on the web server, I'm seeing this.

SC
0
Where do we find the script that processes a form originally setup in Rules? We need to validate fields in a multipage 2-page form. I assume it is processed by a php script somewhere.
0
I'm testing a simple SQL query from my Products table, in the Navigator_Data database, whihc is the second database to my Drupal site.

I put this in a Block (PHP code text format), and get this error.

<?php
  $navigator_array = array(
      'database' => 'navigator_data',
      'username' => 'sandshakimi', 
      'password' => 'XXX', 
      'host' => 'localhost', 
      'driver' => 'mysql', 
  );
  Database::addConnectionInfo('PRODUCT', 'default', $navigator_data);
  db_set_active('PRODUCT');
  $result = mysql_query('SELECT * FROM `PRODUCT` ');
  db_set_active(); // without the paramater means set back to the default for the site

?>

Open in new window


 SCscdata-2.JPG
0
Our Drupal site is to leverage data from a second MySQL database. The conneciton is already in place in settings.php

I'm wondering now if there is a module I can use to interact with it (select, update, etc). Or at least what's the best practice working with SQL queries - GUI with a module, or code?

One goal is to display the results on screen, and allow the User to filter rows and columns.
0
So I've got a working consumption of a web service.

My goal is to create a form, capture the values by a User, then process that through the web service. Then throw the results back up on the page.

I'm thinking this is pretty straightforward? Is there some template I can starting using?

<html>  
<head>  
<title>Call to Navigator Web Service</title>  
</head>  
<body>  
<?php    


$param = array('commodity' => 'LAPTOP',  'placeOfPerformance' => array('location' => 'LSA' , 'lsaStates' => 'NY', 'VA', 'TX', 'oconusStates' => 'ALASKA', 'EMEA'),  'equipmentType' => 'ANY', 'socioEconomicObjective' => 'NONE', 'agencyCode' => '007',);

$client = new SoapClient('https://sso-test.fas.gsa.gov/mpdev/navigator/wsdl');  
$results = $client->__soapCall('retrieveContractVehicles', array('parameters' => $param));  
  
print_r($results);  
echo ("<br />");
echo ("We are crazy 8");
  
?>  
</body>  
</html>  

Open in new window

0
Getting white screen, even with error reporting on, when trying to test a SOAP transaction.

<?php
ini_set('display_errors',1);  
error_reporting(E_ALL);
require_once('lib/nusoap.php');
$client = new nusoap_client('https://sso-test.fas.gsa.gov/mpdev/navigator/wsdl','wsdl');
$result = $client->call('retrieveContractVehicles', array(
			'commodity' => 'LAPTOP',
			'location' => 'CONUS',
			'lsaStates' => 'VA',
			'oconusStates' => 'ALASKA',
			'socioEconomicObjective' => 'SB',
			'agencyCode' => '006'));
?>

Open in new window

0
We are starting to use Drupal as the main web platform (moving away from a .net CMS solution) and have a couple of eCommerce sites lined up.
Having not used Drupal that often and have not set up an ecommerce solution on this platform yet I was looking for a bit of advice. So please excuse me if the question sounds a bit dumb.

I notice with http://market.envato.com/ that there are themes for Drupal ecommerce and source for ecommerce. Is it a case that you get a drupal ecommrce theme and then an ecommerce solution (such as opencart or ubercart) or is it that when you gaet a drupal ecommerce theme that it comes wioth it's own cart.

Either way what are developers preferred solution for developing e-commerce solutions in Drupla. What are the pros and cons of each including things such as stock control, shipping  etc....
0
I'm going back and forth between using a contrib module (like wsclient) versus trying to custom code PHP to consume a third party web service.

I'm experimenting with the PHP SOAP library, and nuSoap. I don't have a lot of deep PHP coding experience so it's been a challenge.

So I would like some opinion about where to focus my time, one approach versus the other. Or does it involve a hybrid appraoch?
0
Data Selector Interface in Rules
Working within a Rule, and attempting to add the Data Selector value
 cv-result:retrieveContractVehiclesResponse at the bottom of the drop-down, Drupal is not allowing me to select it.

The nearest I can select is this:

Screen Capture
What should I investigate?
0
Drupal uses cookie based session management.
Our application is embedded in other applications, such as Facebook, iFrame....
Users browser blocks 3rd-party cookie. So Drupal cookie based session management does not work.

How to develop a no cookie session management for Drupal website ?

For example, the following is some information.
https://www.drupal.org/sandbox/veljkopopovic/1998840
This is a sandbox project.
Helps you bypass cookie based session management on your Drupal site.
This is good approach for embedded sites, for example Facebook iframe based embedded applications
which will allow you to implement fully functional Drupal site within iframe avoiding problems
with browser cross-domain cookie restrictions.
0
Laptop Buttons
Got a use case where the User selects a laptop button, and the specs appear on the right.

So the requirements are:

1) Dynamic data is pushed to the sidebar
2) The data (laptop specs) are stored in the Drupal database

And longer term..

3) The data (laptop specs) might come in via web service as more laptop buttons are offered.

What's the best approach for #1 & #2, and what technologies should I consider for #3?
0
Hi

I am new to Drupal but I wanted to give it a whirl to get my vinyl record collection online. I am looking to have a way of importing the data and multiple fields for text data and images. CSS and layout seems straight forward, but...

I wondered if there is a module or plugin that gets me there quicker out of the box, but searching for "database" "drupal" and "record collections" on the old google does not return much useful info due to double meanings of the search words.

Does anyone have a recommendation or a good site beyond the standard Drupal reference sites that helps getting me started?

Thanks
capt.
0
This is a pricing meter that is suppposed to reflect options that a user chooses (it will be in a form below).

Example, user is selecting a laptop, making adjustments to CPU, memory, screen size, etc.

As they make choices and recalculate the price meter should animate to reflect the new price.

This will be done in Drupal. Are there existing modules? Or if not Drupal, exisiting JavaScript frameworks that can get me here?

screen capture
0
We have a Drupal website embedded to other websites.
For example, the websites can embed our website in their website as following:
<iframe src="drupal_site_url"></iframe>

In this situation, Drupal site cookie becomes third-party cookie.

Now more people block third-party cookie, so our Drupal site can not function inside
the other websites this way.

We have a control for the websites which embed our Drupal site.
For example, we can modify the way like JavaScript, iframe.... to embed the Drupal site.
Is there a method to make our Drupal site cookie become first-party cookie?
0
I inherited an existing drupal site.  I created a gallery content type and I am trying to pull it through a view (Page).  I keep getting a page not found error when I go to my path /galleries.  I added a block to the view, I can see the block but the 'page' keeps saying "Page Not Found" see attachment.  This is beyond frustrating.  Steps I have taken:

Clear cache
recreate view
check any aliases
Pull my hair out

Screenshot of View Page Screenshot of view Page settings
0

Drupal

Drupal is an open-source content-management framework written in PHP used as a back-end framework for websites and is also used for knowledge management and business collaboration. The standard release of Drupal contains basic features common to content management systems, including user account registration and maintenance, menu management, RSS feeds, taxonomy, page layout customization, and system administration. Drupal runs on any computing platform that supports both a Web server capable of running PHP and a database to store content and configuration.

Top Experts In
Drupal
<
Monthly
>