| 33 |
* and so can you and just anyone down the chain as long as the GPL v2 or later |
* and so can you and just anyone down the chain as long as the GPL v2 or later |
| 34 |
* terms are abided by, the module distributor in that case being the |
* terms are abided by, the module distributor in that case being the |
| 35 |
* drupal.org organization or the downstream distributor, not OSInet. |
* drupal.org organization or the downstream distributor, not OSInet. |
| 36 |
* */ |
*/ |
| 37 |
|
|
| 38 |
/** |
/** |
| 39 |
* Miscellaneous data |
* Miscellaneous data |
| 169 |
'path' => ZGPATHPAGE, |
'path' => ZGPATHPAGE, |
| 170 |
'title' => t('Zeitgeist'), |
'title' => t('Zeitgeist'), |
| 171 |
'description' => t('Feel the Zeitgeist'), |
'description' => t('Feel the Zeitgeist'), |
| 172 |
'callback' => 'zeitgeist_page', |
'callback' => '_zeitgeist_page', |
| 173 |
'type' => MENU_NORMAL_ITEM, |
'type' => MENU_NORMAL_ITEM, |
| 174 |
'access' => user_access('administer search'), |
'access' => user_access('administer search'), |
| 175 |
); |
); |
| 194 |
'#size' => 4, // this is good until 2037, should be enough for all 5.x needs. |
'#size' => 4, // this is good until 2037, should be enough for all 5.x needs. |
| 195 |
'#maxlength' => 4, |
'#maxlength' => 4, |
| 196 |
); |
); |
| 197 |
|
|
| 198 |
$form['zeitgeist-display'] = array |
$form['zeitgeist-display'] = array |
| 199 |
( |
( |
| 200 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 201 |
'#title' => t('Display settings'), |
'#title' => t('Display settings'), |
| 202 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 203 |
); |
); |
| 204 |
|
|
| 205 |
$form['zeitgeist-display']['zeitgeist-top'] = array |
$form['zeitgeist-display']['zeitgeist-top'] = array |
| 206 |
( |
( |
| 207 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 214 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 215 |
'#title' => t('Top searches displayed'), |
'#title' => t('Top searches displayed'), |
| 216 |
'#description' => t('This is the number of top searches displayed in the "Top Searches" block provided by the zeitgeist module. Default: %def.', |
'#description' => t('This is the number of top searches displayed in the "Top Searches" block provided by the zeitgeist module. Default: %def.', |
| 217 |
array('%def' => ZGDEFTOPCOUNT)), |
array('%def' => ZGDEFTOPCOUNT)), |
| 218 |
'#default_value' => variable_get(ZGVARTOPCOUNT, ZGDEFTOPCOUNT), |
'#default_value' => variable_get(ZGVARTOPCOUNT, ZGDEFTOPCOUNT), |
| 219 |
'#maxlength' => 2, |
'#maxlength' => 2, |
| 220 |
'#size' => 2, |
'#size' => 2, |
| 241 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 242 |
'#title' => t('Latest searches displayed'), |
'#title' => t('Latest searches displayed'), |
| 243 |
'#description' => t('This is the number of recent searches displayed in the "Latest Searches" block provided by the zeitgeist module. Default: %def.', |
'#description' => t('This is the number of recent searches displayed in the "Latest Searches" block provided by the zeitgeist module. Default: %def.', |
| 244 |
array('%def' => ZGDEFLATESTCOUNT)), |
array('%def' => ZGDEFLATESTCOUNT)), |
| 245 |
'#default_value' => variable_get(ZGVARLATESTCOUNT, ZGDEFLATESTCOUNT), |
'#default_value' => variable_get(ZGVARLATESTCOUNT, ZGDEFLATESTCOUNT), |
| 246 |
'#maxlength' => 2, |
'#maxlength' => 2, |
| 247 |
'#size' => 2, |
'#size' => 2, |
| 269 |
'#size' => 5, |
'#size' => 5, |
| 270 |
'#maxlength' => 5, |
'#maxlength' => 5, |
| 271 |
); |
); |
| 272 |
|
|
| 273 |
$form['zeitgeist-display']['zeitgeist-page'] = array |
$form['zeitgeist-display']['zeitgeist-page'] = array |
| 274 |
( |
( |
| 275 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 285 |
'#size' => 3, |
'#size' => 3, |
| 286 |
'#maxlength' => 3, |
'#maxlength' => 3, |
| 287 |
); |
); |
| 288 |
|
|
| 289 |
$form['zeigeist-filtering'] = array |
$form['zeigeist-filtering'] = array |
| 290 |
( |
( |
| 291 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 330 |
'#default_value' => variable_get(ZGVARNOFOLLOW, ZGDEFNOFOLLOW), |
'#default_value' => variable_get(ZGVARNOFOLLOW, ZGDEFNOFOLLOW), |
| 331 |
'#return_value' => 1, |
'#return_value' => 1, |
| 332 |
'#description' => t('An attribute for the "a" (X)HTML alement, !attr is non-standard, but is recognized by several search engines, notably Google, MSN and Yahoo!', |
'#description' => t('An attribute for the "a" (X)HTML alement, !attr is non-standard, but is recognized by several search engines, notably Google, MSN and Yahoo!', |
| 333 |
array('!attr' => '<code>rel="nofollow"</code>')), |
array('!attr' => '<code>rel="nofollow"</code>')), |
| 334 |
); |
); |
| 335 |
$form['advanced'][ZGVERSION] = array |
$form['advanced'][ZGVERSION] = array |
| 336 |
( |
( |
| 337 |
'#value' => '<p>' |
'#value' => '<p>' |
| 338 |
. t('This site is running Zeitgeist version %version. ', array('%version' => ZGVERSION)) |
. t('This site is running Zeitgeist version %version. ', array('%version' => ZGVERSION)) |
| 339 |
. '</p>' |
. '</p>' |
| 340 |
); |
); |
| 437 |
$form = array(); |
$form = array(); |
| 438 |
break; |
break; |
| 439 |
} |
} |
| 440 |
zeitgeist_admin_settings_submit(NULL, NULL); // clear cache |
_zeitgeist_admin_settings_submit(NULL, NULL); // clear cache |
| 441 |
return $form; |
return $form; |
| 442 |
break; |
break; |
| 443 |
|
|
| 741 |
variable_set(ZGVARLATESTCLEAR, $today); |
variable_set(ZGVARLATESTCLEAR, $today); |
| 742 |
} |
} |
| 743 |
|
|
| 744 |
|
|
| 745 |
/** |
/** |
| 746 |
* Default rendering for the ZG block with the most popular "node" queries |
* Default rendering for the ZG block with the most popular "node" queries |
| 747 |
* during the preceding month |
* during the preceding month |
| 751 |
function theme_zeitgeist_block_top() |
function theme_zeitgeist_block_top() |
| 752 |
{ |
{ |
| 753 |
$count = variable_get(ZGVARTOPCOUNT, ZGDEFTOPCOUNT); |
$count = variable_get(ZGVARTOPCOUNT, ZGDEFTOPCOUNT); |
| 754 |
$ts = null; |
$ts = NULL; |
| 755 |
|
|
| 756 |
/** |
/** |
| 757 |
* Uncomment this fragment for last month's zeitgeist. Leave it commented for |
* Uncomment this fragment for last month's zeitgeist. Leave it commented for |
| 770 |
: NULL ; |
: NULL ; |
| 771 |
foreach ($arStats->scores as $score) |
foreach ($arStats->scores as $score) |
| 772 |
{ |
{ |
| 773 |
$arScores[] = l($score['search'] . " (${score['count']})", |
$arScores [] = l($score['search'] . " (${score['count']})", |
| 774 |
"search/node/$score[search]", $attr, NULL, NULL, TRUE); |
"search/node/$score[search]", $attr, NULL, NULL, TRUE); |
| 775 |
} |
} |
| 776 |
unset($arStats); |
unset($arStats); |
| 777 |
|
|
| 778 |
$ret = theme('item_list', $arScores); |
$ret = theme('item_list', $arScores); |
| 779 |
unset($arScores); |
unset($arScores); |
| 780 |
|
|
| 781 |
return $ret; |
return $ret; |
| 782 |
} |
} |
| 783 |
|
|
| 871 |
* |
* |
| 872 |
* @return string HTML |
* @return string HTML |
| 873 |
*/ |
*/ |
| 874 |
function zeitgeist_page_single_column() |
function _zeitgeist_page_single_column() |
| 875 |
{ |
{ |
| 876 |
$height = variable_get(ZGVARPAGEHEIGHT, ZGDEFPAGEHEIGHT); // pager height |
$height = variable_get(ZGVARPAGEHEIGHT, ZGDEFPAGEHEIGHT); // pager height |
| 877 |
|
|
| 915 |
* @return string |
* @return string |
| 916 |
* @see _zeitgeist_stats() |
* @see _zeitgeist_stats() |
| 917 |
*/ |
*/ |
| 918 |
function zeitgeist_page($days = 30) |
function _zeitgeist_page($days = 30) |
| 919 |
{ |
{ |
| 920 |
if (!is_numeric($days)) |
if (!is_numeric($days)) |
| 921 |
{ |
{ |
| 997 |
* @param string $form_id |
* @param string $form_id |
| 998 |
* @param array $form_values |
* @param array $form_values |
| 999 |
*/ |
*/ |
| 1000 |
function zeitgeist_admin_settings_submit($form_id, $form_values) |
function _zeitgeist_admin_settings_submit($form_id, $form_values) |
| 1001 |
{ |
{ |
| 1002 |
cache_clear_all(ZGCIDLATEST, 'cache'); |
cache_clear_all(ZGCIDLATEST, 'cache'); |
| 1003 |
cache_clear_all(ZGCIDTOP, 'cache'); |
cache_clear_all(ZGCIDTOP, 'cache'); |