• RSS
  • Facebook
  • Twitter

דרופל

בכדי להסיר את הנקודתיים משדה label עליך לשים את הפונקציה הבאה בתוך template.php בתבנית שלך.

לא לשכוח לשנות בתחילת הפונקציה את theme עם שם התבנית שלך, כפי שהיא מופיעה בתקייה.

function theme_form_element($element, $value) {
// This is also used in the installer, pre-database setup.
$t = get_t();
$output = '<div class="form-item"';
if (!empty($element['#id'])) {
$output .= ' id="'. $element['#id'] .'-wrapper"';
}
$output .= ">n";
$required = !empty($element['#required']) ? '<span class="form-required" title="'. $t('This field is required.') .'">*</span>' : '';
if (!empty($element['#title'])) {
$title = $element['#title'];
if (!empty($element['#id'])) {
$output .= ' <label for="'. $element['#id'] .'">'. $t('!title !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
else {
$output .= ' <label>'. $t('!title !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
}
$output .= " $valuen";
if (!empty($element['#description'])) {
$output .= ' <div class="description">'. $element['#description'] ."</div>n";
}
$output .= "</div>n";
return $output;
}

הוגש בחסות חלב ודבש בניית אתרים

קוד ה PHP הבא יכול לאפשר או לא לאפשר הצגת בלוק מסויים לפי סוגי תוכן:

<?php
if ((arg(0) == 'node') && is_numeric(arg(1)) && (! arg(2))) {
$node = node_load(arg(1));
return ($node->type == 'product');
}
return FALSE;
?>

הקוד ה PHP בא מאפשר או לא מאפשר לכמה סוגי תוכן:

<?php
if ((arg(0) == 'node') && is_numeric(arg(1)) && (! arg(2))) {
$node = node_load(arg(1));
return ($node->type == 'product', 'gallery');
}
return FALSE;
?>

מוגש באדיבות חלב ודבש בניית אתרים בדרופל

הקוד הבא מאפשר לייצא את כלל רשימת המשתמשים באתר שלכם לקובץ אקסל.

<?php
$_csv_data = 'User Id, User name, User Email, User Status, User Created Date, User Last Access Date'. "n";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename="users-list.csv"");
$result = db_query('SELECT DISTINCT u.uid, u.name, u.mail as email, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid WHERE u.uid > 0');
while ($account = db_fetch_object($result))
{
$created = date("m.d.y", $account->created);
$access = date("m.d.y", $account->access);
$_csv_data .= $account->uid.','.$account->name.','.$account->email.','.$account->status.','.$created.','.$access . "n";
}
echo $_csv_data;
?>

בכדי להוסיף בלוג בתבניות השונות של העמודים באתר שלך עליך להכניס את הקוד הבא ולשנות את הפרמטרים: מס' בלוק ושם המודול:

<?php
$block = module_invoke('module_name', 'block', 'view', 0);
print $block['content'];
?>

מפרסמים