Holding onto a random variable

Hello,

I am trying to put together a module that lets the user select a number of different items from a checklist, and then have one randomly displayed on one of two blocks generated by the module.

The trouble I am having is making sure the second block does not replicate the contents of the first one. Once I pick a random value, I can't seem to use it again to check the second value against as it keeps changing. Here's the relevant code from my preprocess function 'fluid list' is the array of values from the checkboxes.

These are both in the same hook_preprocess_block() function, but in different if statements.
Here's where I grab the first variable:

$vid_array = variable_get('fluid_list');
		shuffle($vid_array);
		$vid_array = array_values($vid_array);
		variable_set('first_vid',$vid_array[0]);

it goes on to make some queries and set variables with the $vid_array[0] value

but then when I grab it again here:

$vid_array02 = array_values(variable_get('fluid_list02'));
$first_vid = variable_get('first_vid');
	
foreach($vid_array02 as $key => $value){
	if($first_vid == $value){
	$splice_here_key = $key;
	break;
	}
}
array_splice($vid_array02, $splice_here_key, 1);
$vid[0] = array_rand(array_flip($vid_array02), 1);

Panels and google

Hi, I'm new to Drupal and have been trying to figure out how to use panels effectively.

If I use panels to pull in content from a page/node which acts as a container for that portion of content will these pages be indexed by Google as well as the panel page?

If so, whats the best way to hide them? Or is what I'm trying to do not 'best practice'?

All feedback greatly appreciated

Views or Views Slideshow

Hi all,

I am trying to create a slideshow that would be showing 3 instances of my custom contant type "Slideshow Image". After spending hours without any success I've decided to seek your help! I noticed that "Views" changed a lot when I updated all modules, and it seems as if "slideshow" is not among the options for display under "Format" in the control panel of my View. I have Grid, HTML list, Jump menu, Table, Unformatted list but no slideshow. Now, I think I remember seeing "slideshow" as an option before "Views" changed! My questions are:

need help with basic jquery UI dialog - form API question

Hi,
I'm using D7.
I have a module that creates a form, the form has an 'Add' button.
I want that a click on the button will open a modal dialog box (I was thinking jQuesry UI dialog) with few textfields for the user the enter data and click the submit on the dialog. This will close the dialog and add the data from the dialog to the form (via ajax call if possible) - so the form will have new entries.

module views, problem with a thumb view

Hello there!
This is my first posting in this forum.

I have a problem/query with the appearance of view-module page.
I created a content type with a title, image, short description & tagging fields.
Till now all right... The issue appears when i create a view to gather all specific content type and present them when someone clicks the menu item i had assigned it to.

Add user/change pass with php or shell script

Found a workaround for this. Thanks for the help, y'all.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x