uc_product_table fgv felülírás

jabba306 képe

Sziasztok!

Szerettem volna a http://drupal.hu/forum/cck-mez%C5%91-templatephp-b%C3%B3l
topik utolsó hozzászólását megvalósítani, de valamiért nem működik. A modul létrejött, be tudom kapcsolni, jogosultságot beállítottam, de ennek ellenére nem csinál semmit.

A mini modulom a következőképpen néz ki:

Drupal verzió: 
Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
dorion képe

A saját megoldásaom a saját kérdésemre nem tökéletes még és biztos lehet és kellene finomítani, de működik :-)

$formulas[] = array(
                'pass'  => TRUE,
                'dates' => array(
                                'start_date'  => '',
                                'end_date'    => '2007-05-30',
                            ),
                'days'  => array(
                                'Mondays'    => 1,
                                'Tuesdays'   => 1,
                                'Wednesdays' => 1,
                                'Thursdays'  => 1,
                                'Fridays'    => 1,
                                'Saturdays'  => 0,
                                'Sundays'    => 0,
                            ),
                'times' => array(
                                0 => '00:00',
                                1 => '01:10',
                            ),
            );
$formulas[] = array(
                'pass'  => FALSE,
                'dates' => array(
                                'start_date'  => '2007-05-20',
                                'end_date'    => '2007-05-28',
                            ),
                'days'  => array(
                                'Mondays'    => 1,
                                'Tuesdays'   => 0,
                                'Wednesdays' => 0,
                                'Thursdays'  => 0,
                                'Fridays'    => 0,
                                'Saturdays'  => 0,
                                'Sundays'    => 0,
                            ),
                'times' => array(
                                0 => '00:00',
                                1 => '01:10',
                            ),
            );
 
function valid_timestamps($formulas){
 
  $valid_dates = array();
  foreach($formulas as $formula){
 
    if(isset($formula['dates']['start_date']) AND !empty($formula['dates']['start_date'])){
      if(time() < strtotime("18:00-00:00")){
        $start_date = $formula['dates']['start_date'] . '00:00-00:00';  
        $start_date = strtotime($start_date);
      }
      else{
        $start_date = $formula['dates']['start_date'] . ' 23:59-00:00';  
        $start_date = strtotime("$start_date");
      }
    }
    else{
      $start_date = date('Y-m-d G:i',time());
      $start_date[15] = 0;
      $start_date = strtotime($start_date);
    }
 
    if(isset($formula['dates']['end_date']) AND !empty($formula['dates']['end_date'])){
      $end_date = $formula['dates']['end_date'] . '-23:59';  
      $end_date = strtotime($end_date);
    }
    else{
      $pre_book = variable_get('booking_system_max_prebook', 12);
      $end_date = strtotime("+$pre_book month 23:59");
    }
 
    $count = $start_date;
    $timestamps = array();
    $week = 0;
    while($count <= $end_date){
      foreach($formula['days'] as $day => $value){
        if($value === 1){
          foreach($formula['times'] as $time){
            #print $date = strtotime($date). '<br>' ;
            $date = gmdate('Y-m-d',strtotime("+$week week $day",$start_date)).' '.$time.'-00:00';
            $timestamps[] = gmdate('Y-m-d l H:i',strtotime($date));
          }  
        }
      }
 
      $count = strtotime("+$week day",$start_date);   
 
      $week++;  
    }
    if($formula['pass'] == TRUE){
      $valid_dates = array_merge($valid_dates, $timestamps);  
    }
    else{
      $valid_dates = array_diff($valid_dates, $timestamps);
    }
   print_r($timestamps);
 
  }
  $valid_dates = array_unique($valid_dates); 
 
  return print_r($valid_dates);
}

A valid timestamp-ek adja vissza amivel egy select inputot simán felehet paraméterezni és az adatbázisban is kényelmesebb a tárolása.

0
0
pante képe

Biztonság kedvéért letöröltem, gondoltam hátha csak ez a baja és egy újratelepítés megoldja a problémákat.

Viszont nem törlődött rendesen, hanem még hagyott hibákat a rendszerben.
"Szerencsére" csak az admin panelben látszódnak a felhasználók nem érzékelnek változást.
Felépítés -> Blokkok:
Notice: Undefined index: name _ctools_list_themes() függvényben (/public_html/sites/all/modules/ctools/includes/plugins.inc 567 sor).
Megjelenés:

  1. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  2. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  3. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  4. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  5. Notice: Undefined index: name system_sort_modules_by_info_name() függvényben (/public_html/modules/system/system.admin.inc 925 sor).
  6. Notice: Undefined index: name system_sort_modules_by_info_name() függvényben (/public_html/modules/system/system.admin.inc 925 sor).
  7. Notice: Undefined index: name system_sort_modules_by_info_name() függvényben (/public_html/modules/system/system.admin.inc 925 sor).
  8. Warning: uasort() [function.uasort]: Array was modified by the user comparison function system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 131 sor).
  9. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 140 sor).
  10. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 158 sor).
  11. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 159 sor).
  12. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 182 sor).
  13. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 191 sor).
  14. Notice: Undefined index: name system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 197 sor).
  15. Notice: Undefined index: name system_sort_themes() függvényben (/public_html/modules/system/system.admin.inc 938 sor).
  16. Warning: uasort() [function.uasort]: Array was modified by the user comparison function system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 237 sor).
  17. Notice: Undefined index: name theme_system_themes_page() függvényben (/public_html/modules/system/system.admin.inc 2708 sor).

Modulok:
  1. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  2. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).

Jelentések:
  1. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).
  2. Notice: Undefined index: name _system_rebuild_theme_data() függvényben (/public_html/modules/system/system.module 2563 sor).

Illetve Beállításokban is ott maradt a modul linkje, amire kattintva 500 HTTP hiba (Internal Server Error) jön be.

Hogy tudnám teljesen eltávolítani ezt a modult a rendszerből? Mert a többi modul (pl. CTools) nem írt még ki hibákat, de most már igen.

0
0
ipeto képe

Majdnem tökéletesen jó, köszönöm szépen. Nagy és fontos újdonság számomra a Page Manager, de a hétvégi olvasgatásból a nézettel közösen való használata kimaradt.
Igazából egyetlen rész nem akar működni: nem jelenik meg a menüpont a megfelelő helyen (igazából sehol sem). A következő oldalt hoztam létre:

  1. $page = new stdClass();
  2. $page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
  3. $page->api_version = 1;
  4. $page->name = 'munkatars_profil';
  5. $page->task = 'page';
  6. $page->admin_title = 'Munkatárs profilja';
  7. $page->admin_description = '';
  8. $page->path = 'sajat/oldal';
  9. $page->access = array();
  10. $page->menu = array(
  11. 'type' => 'normal',
  12. 'title' => 'Profil',
  13. 'name' => 'main-menu',
  14. 'weight' => '0',
  15. 'parent' => array(
  16. 'type' => 'normal',
  17. 'title' => '',
  18. 'name' => 'navigation',
  19. 'weight' => '0',
  20. ),
  21. );
  22. $page->arguments = array();
  23. $page->conf = array(
  24. 'admin_paths' => FALSE,
  25. );
  26. $page->default_handlers = array();
  27. $handler = new stdClass();
  28. $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
  29. $handler->api_version = 1;
  30. $handler->name = 'page_munkatars_profil_http_response';
  31. $handler->task = 'page';
  32. $handler->subtask = 'munkatars_profil';
  33. $handler->handler = 'http_response';
  34. $handler->weight = 0;
  35. $handler->conf = array(
  36. 'title' => 'HTTP válaszkód',
  37. 'contexts' => array(
  38. 0 => array(
  39. 'identifier' => 'Nézet - hivatkozott felhasználó',
  40. 'keyword' => 'view-referenced-user',
  41. 'name' => 'view:ref_hivatkozott_felhasznalo-ctools_context_1',
  42. 'id' => 1,
  43. ),
  44. ),
  45. 'relationships' => array(
  46. 0 => array(
  47. 'identifier' => 'Node from view',
  48. 'keyword' => 'node',
  49. 'name' => 'node_from_view',
  50. 'row' => '1',
  51. 'context' => 'context_view:ref_hivatkozott_felhasznalo-ctools_context_1_1',
  52. 'id' => 1,
  53. ),
  54. ),
  55. 'code' => '301',
  56. 'destination' => 'node/%node:nid',
  57. );
  58. $page->default_handlers[$handler->name] = $handler;

Ahogy írtam, a menüelem automatikusan nem jelent meg a főmenüben. A tegnapi elvetélt próbálkozásaimnál ez nem volt gond. Ugyanakkor az útvonal működik, szépen átdob a megfelelő node-ra. Kézzel nyilván létre lehet hozni a menüt, de érdekelne, mi lehet a gond.

0
0
Hojtsy Gábor képe

// $Id$
 
/**
 * @file
 *   Adminisztrációt segítő funkciók a Drupal.hu számára.
 */
 
/**
 * hook_menu() megvalósítás.
 */
function publishboard_menu() {
  $items['publishboard/%'] = array(
    'title'            => 'Beküldött tartalmak',
    'page callback'    => 'publishboard_page',
    'page arguments'   => array(1),
    'access arguments' => array('access administration pages'),
    'type'             => MENU_CALLBACK,
  );
  return $items;
}
 
/**
 * hook_block() megvalósítás.
 */
function publishboard_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    return array(0 => array('info' => 'Beküldött tartalmak',
      'weight' => -100, 'enabled' => 1, 'region' => 'right'));
  }
  elseif ($op == 'view' && user_access("access administration pages")) {
    $items = array();
    $names = node_get_types('names');
    list($types, $changed, $unchanged) = publishboard_unread_counters();
    foreach ($types as $type) {
      $title = '';
      if (isset($unchanged[$type]) || isset($changed[$type])) {
        if (isset($changed[$type])) {
          $title .= '<span class="marker">'. $changed[$type] .' új</span>'. (isset($unchanged[$type]) ? ', ' : ' ');
        }
        if (isset($unchanged[$type])) {
          $title .= $unchanged[$type] .' régi ';
        }
        $items[] = @l($title . check_plain($names[$type]), 'publishboard/'. $type, array('html' => true));
      }
    }
    if (count($items)) {
      return array(
        'subject' => 'Beküldött tartalmak',
        'content' => theme('item_list', $items),
      );
    }
  }
}
 
function publishboard_page($type) {
  $_SESSION['node_overview_filter'] = array(
    array('status', 'status-0'),
    array('type', $type),
  );
  drupal_goto('admin/content/node');
}
 
/**
 * A nem olvasott tartalmak számának összesítése.
 */
function publishboard_unread_counters() {
  global $user;
 
  $unchanged = $changed = $list = $types = array();
 
  $result = db_query('SELECT nid, type, changed FROM {node} WHERE status = 0');
  while ($node = db_fetch_object($result)) {
    $list[$node->nid] = $node;
    if (!in_array($node->type, $types)) {
      $types[] = $node->type;
    }
  }
 
  if (count($types)) {
    // Nézzük, hogy az éppen látogató user melyeket látta már ezekből legutóbbi
    // módosításuk óta (melyek így tényleg újak a számára).
    $part = join(", ", array_keys($list));
    $result = db_query("SELECT nid, timestamp FROM {history} WHERE uid = %d AND nid IN ($part)", $user->uid);
    while ($history = db_fetch_object($result)) {
      if ($list[$history->nid]->changed > $history->timestamp) {
        // Van róla adatunk, és régebben látta, mint amikor legutóbb változott.
        @$changed[$list[$history->nid]->type]++;
      }
      else {
        // Volt róla adat, de a változás régebbi, mint a látogatás.
        @$unchanged[$list[$history->nid]->type]++;
      }
      // Kezeltük a history tábla alapján.
      unset($list[$history->nid]);
    }
  }
 
  // Ezeket nem találtuk meg a history táblában, azaz soha nem látta a user,
  // vagy nagyon régen látta. Csak a limitet tudjuk alapul venni.
  foreach ($list as $node) {
    if ($list[$node->nid]->changed > NODE_NEW_LIMIT) {
      @$changed[$node->type]++;
    }
    else {
      @$unchanged[$node->type]++;
    }
  }
 
  return array($types, $changed, $unchanged);
}
gerisz képe

Próbáljad ki amit aboros írt!

1) - book-navigation.tpl.php

http://api.drupal.org/api/drupal/modules--book--book-navigation.tpl.php/...

Ctrl+C / Ctrl+V

book-navigation.tpl.php

Másoljad elé:

A)

Ha a share modul "fent" van(http://drupal.org/project/facebookshare) Beállításoknál nem kell megadnod a tartalom típusodat, majd mi kitesszük:

<?php
$url = url('node/' . $object->nid, array('absolute' => TRUE));
print theme('facebookshare', $url);
?>

(csak a lapozóban fog szerepelni)

Más tartalom típusnál:
a node.tpl.php -ba a <?php print $links; ?> linkek felé/fölé

<?php  if  ($node->type != 'mynode' && !$teaser): ?>
<?php
$url = url('node/' . $object->nid, array('absolute' => TRUE));
print theme('facebookshare', $url);
?>
<?php endif; ?>
<br/>

B)

A blokkos megoldás

blokkot létrehozol, belepötyögöd amit szeretnél(http://developers.facebook.com/docs/plugins/)

most pedig ezt másold elé:

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

(így nem kell 2 modult feltenned, fentebb le van írva hogy mi a myblock"ID")

A többi tartalomtípusnál:
a node.tpl.php -ba a <?php print $links; ?> linkek felé/fölé

<?php  if  ($node->type != 'mynode' && !$teaser): ?>
<?php 
$block = module_invoke('block', 'block', 'view', 'myblockid');
print $block['content'];
?>
<?php endif; ?>
<br/>

(ki kell hagyni azt a tartalomtípust ahol a lapozó van, mert nem akarjuk duplán megjeleníteni, na meg nem akarjuk a bevezetőben sem látni. A lapozós tartalomnál azért nem kell a bevezető és teljes nézettel foglalkozni mert a lapozó csak teljes nézetben látszik. A 'mynode' annak a tartalomnak a neve ahol a lapozót használod, myblock amit már írtam)

2) - preprocess

A)

A mytheme könyvtára(valahogy így néz ki a könyvtárszerkezeted, vagy nem)

 //css fájlok
[images] //képek
[templates] //page.tpl.php, node.tpl.php stb...
mytheme.info // szokásos + base theme = koi - a te esetedben
template.php //nincs semmilyen almappában ahogyan pp írta
 
(adjuk a tartalmainkhoz a blokkot amiben a facebookos dolgaink vannak.)
 
[geshifilter-code]&#10;function mytheme_preprocess_node(&amp;$vars) {&#10;if ($vars[&#039;page&#039;] == TRUE &amp;&amp; $vars[&#039;teaser&#039;] == NULL ) &#10;{&#10;$adblock = module_invoke(&#039;block&#039;, &#039;block&#039;, &#039;view&#039;, myblockid);&#10;	   &#10;$vars[&#039;content&#039;] = &#10;	  &#10;&#039;&lt;div class=&quot;social&quot;&gt;&#039; .&#10;$vars[&#039;content&#039;] .= &#039;&#039; . $adblock[&#039;content&#039;] .&#10;&#039;&lt;/div&gt;&#039;&#10;&#10;;&#10;&#10;}&#10;}&#10;[/geshifilter-code] 
mynode, myblockid - értelemszerűen!
Minden tartalomtípusban megjelenik .Meg ugye bár csak teljes nézetben!
 
Így a blokkod a node tartalma és a kommentek között lesz. Ez a legszebb megoldás.
 
(Viszont így a blokk és tartalma, a könyv típusú tartalomnál a lapozó alatt fog megjelenni.)
 
 
 
B)Ha a lapozó felett akarod:
 
[geshifilter-code]&#10;function mytheme_preprocess_node(&amp;$vars) {&#10;if ($vars[&#039;node&#039;]-&gt;type != &#039;mynode&#039; &amp;&amp;  $vars[&#039;page&#039;] == TRUE &amp;&amp; $vars[&#039;teaser&#039;] == NULL ) &#10;{&#10;$adblock = module_invoke(&#039;block&#039;, &#039;block&#039;, &#039;view&#039;, myblockid);&#10;	   &#10;$vars[&#039;content&#039;] = &#10;	  &#10;&#039;&lt;div class=&quot;social&quot;&gt;&#039; .&#10;$vars[&#039;content&#039;] .= &#039;&#039; . $adblock[&#039;content&#039;] .&#10;&#039;&lt;/div&gt;&#039;&#10;&#10;;&#10;&#10;}&#10;}&#10;[/geshifilter-code] 
(kihagytuk a könyv típusú tartalmadat ami a mynode)
 
 book-navigation.tpl.php belepakolod a blokkot ahogyan az első részben és kész is.
 
 
gyorstár
0
0

Csak a szülő kifejezések listázássa

charlos képe

Sziasztok!

Sikerült megoldani a Felfedett szűrés szótár alapján, köszönöm a segítséget! A megoldást végül a Hierarchical Select modul jelentette.

Drupal verzió: 
Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
tiburi képe

Igen a template.php a mindene ezen a sminken (is).

Nekem ha engedem, hogy megjelenjen a lenti "hibaüzenet", akkor az alábbi olvasható a főoldalon a ddblock alatt:

#

'news_items'
 
#

stdClass::__set_state(array(
   'node_title' => 'Életveszély az utcákon',
   'node_data_field_pager_item_text_field_pager_item_text_value' => '3',
   'node_type' => 'ddblock_news_item',
   'nid' => '42',
   'node_vid' => '46',
   'node_data_field_slide_text_field_slide_text_value' => 'hjuihjkhjkhjk ghujghj ghjgjhj',
   'node_data_field_image_field_image_fid' => '502',
   'node_data_field_image_field_image_list' => '1',
   'node_data_field_image_field_image_data' => 'a:3:{s:11:"description";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
   'node_revisions_body' => '
 
Próba ddblock item slide text body Próba ddblock item slide text body Próba ddblock item slide text body Próba ddblock item slide text body
',
   'node_revisions_format' => '2',
   'node_created' => '1266685567',
))

A http://ddblock.myalbums.biz/node/860 elérhető videót végignéztem és hiába írom át a php-t, valahogy nem jelenik meg a kép és a slideshow szövege.
De hol a hiba????

<?php
// $Id: template.php,v 1.1 2009/10/09 09:36:17 antsin Exp $
 
/*
+----------------------------------------------------------------+
|   BlogBuzz for Dupal 6.x - Version 1.0                         |
|   Copyright (C) 2009 Antsin.com All Rights Reserved.           |
|   @license - GNU GENERAL PUBLIC LICENSE                        |
|----------------------------------------------------------------|
|   Theme Name: BlogBuzz                                         |
|   Description: BlogBuzz by Antsin                              |
|   Author: Antsin.com                                           |
|   Website: http://www.antsin.com/                              |
|----------------------------------------------------------------+
*/ 
 
/**
 * Initialize theme settings
 */
if (is_null(theme_get_setting('user_notverified_display'))) {
  global $theme_key;
  // Get node types
  $node_types = node_get_types('names');
 
  /**
   * The default values for the theme variables. Make sure $defaults exactly
   * matches the $defaults in the theme-settings.php file.
   */
  $defaults = array(
    'blogbuzz_style' => 'stone',
  );
 
  // Make the default content-type settings the same as the default theme settings,
  // so we can tell if content-type-specific settings have been altered.
  $defaults = array_merge($defaults, theme_get_settings());
 
  // Get default theme settings.
  $settings = theme_get_settings($theme_key);  
 
  // Don't save the toggle_node_info_ variables
  if (module_exists('node')) {
    foreach (node_get_types() as $type => $name) {
      unset($settings['toggle_node_info_'. $type]);
    }
  }
 
  // Save default theme settings
  variable_set(
    str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
    array_merge($defaults, $settings)
  );
  // Force refresh of Drupal internals
  theme_get_setting('', TRUE);
}
 
function blogbuzz_get_style() {
  $style = theme_get_setting('blogbuzz_style');
  return $style;
}
 
drupal_add_css(drupal_get_path('theme', 'blogbuzz') . '/css/' . blogbuzz_get_style() . '.css', 'theme');
 
function phptemplate_preprocess_page(&$vars) {
 
  // Add conditional stylesheets.
  if (!module_exists('conditional_styles')) {
    $vars['styles'] .= $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'], '');
  }
 
  // Classes for body element. Allows advanced theming based on context
  // (home page, node of certain type, etc.)
  $classes = split(' ', $vars['body_classes']);
  // Remove the mostly useless page-ARG0 class.
  if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $classes)) {
    unset($classes[$index]);
  }
  if (!$vars['is_front']) {
    // Add unique class for each page.
    $path = drupal_get_path_alias($_GET['q']);
    $classes[] = blogbuzz_id_safe('page-' . $path);
    // Add unique class for each website section.
    list($section, ) = explode('/', $path, 2);
    if (arg(0) == 'node') {
      if (arg(1) == 'add') {
        $section = 'node-add';
      }
      elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
        $section = 'node-' . arg(2);
      }
    }
    $classes[] = blogbuzz_id_safe('section-' . $section);
  }
 
  $vars['body_classes_array'] = $classes;
  $vars['body_classes'] = implode(' ', $classes); // Concatenate with spaces.
 
  // Add content top & postscript classes with number of active sub-regions
  $region_list = array(
    'main_bottom' => array('main_bottom_one', 'main_bottom_two', 'main_bottom_three', 'main_bottom_four'), 
    'footer' => array('footer_one', 'footer_two', 'footer_three')
  );
  foreach ($region_list as $sub_region_key => $sub_region_list) {
    $active_regions = array();
    foreach ($sub_region_list as $region_item) {
      if ($vars[$region_item]) {
        $active_regions[] = $region_item;
      }
    }
    $vars[$sub_region_key] = $sub_region_key .'-'. strval(count($active_regions));
  }
 
  // Generate menu tree from source of primary links
  $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
}
 
/**
 * Override or insert variables into the node templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("node" in this case.)
 */
function blogbuzz_preprocess_node(&$vars, $hook) {
  // Special classes for nodes
  $classes = array('node');
  if ($vars['sticky']) {
    $classes[] = 'sticky';
  }
  if (!$vars['status']) {
    $classes[] = 'node-unpublished';
    $vars['unpublished'] = TRUE;
  }
  else {
    $vars['unpublished'] = FALSE;
  }
  if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) {
    $classes[] = 'node-mine'; // Node is authored by current user.
  }
  if ($vars['teaser']) {
    $classes[] = 'node-teaser'; // Node is displayed as teaser.
  }
  // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
  $classes[] = blogbuzz_id_safe('node-type-' . $vars['type']);
  $vars['classes'] = implode(' ', $classes); // Concatenate with spaces
}
 
/**
 * Override or insert variables into the block templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("block" in this case.)
 */
function blogbuzz_preprocess_block(&$vars, $hook) {
  $block = $vars['block'];
 
  // Special classes for blocks.
  $classes = array('block');
  $classes[] = 'block-' . $block->module;
  $classes[] = 'region-' . $vars['block_zebra'];
  $classes[] = $vars['zebra'];
  $classes[] = 'region-count-' . $vars['block_id'];
  $classes[] = 'count-' . $vars['id']; 
 
  // Render block classes.
  $vars['classes'] = implode(' ', $classes);
}
 
function blogbuzz_preprocess_comment(&$vars, $hook) {
  // Add an "unpublished" flag.
  $vars['unpublished'] = ($vars['comment']->status == COMMENT_NOT_PUBLISHED);
 
  // If comment subjects are disabled, don't display them.
  if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) {
    $vars['title'] = '';
  }
 
  // Special classes for comments.
  $classes = array('comment');
  if ($vars['comment']->new) {
    $classes[] = 'comment-new';
  }
  $classes[] = $vars['status'];
  $classes[] = $vars['zebra'];
  if ($vars['id'] == 1) {
    $classes[] = 'first';
  }
  if ($vars['id'] == $vars['node']->comment_count) {
    $classes[] = 'last';
  }
  if ($vars['comment']->uid == 0) {
    // Comment is by an anonymous user.
    $classes[] = 'comment-by-anon';
  }
  else {
    if ($vars['comment']->uid == $vars['node']->uid) {
      // Comment is by the node author.
      $classes[] = 'comment-by-author';
    }
    if ($vars['comment']->uid == $GLOBALS['user']->uid) {
      // Comment was posted by current user.
      $classes[] = 'comment-mine';
    }
  }
  $vars['classes'] = implode(' ', $classes);
}
 
function blogbuzz_preprocess_ddblock_cycle_block_content(&$vars) {
  if ($vars['output_type'] == 'view_fields') {
    $content = array();
    // Add slider_items for the template 
    // If you use the devel module uncomment the following line to see the theme variables
    // dsm($vars['settings']['view_name']);  
    // dsm($vars['content'][0]);
    // If you don't use the devel module uncomment the following line to see the theme variables
    drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');
    drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['settings']['view_name'] == 'showcase_with_image') {
      foreach ($vars['content'] as $key1 => $result) {
        // add slide_image variable 
        if (isset($result->node_data_field_image_field_image_fid)) {
          // get image id
          $fid = $result->node_data_field_image_field_image_fid;
          // get path to image
          $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
          //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
          if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
            $slider_items[$key1]['slide_image'] = 
            theme('imagecache', 
                  $vars['imgcache_slide'], 
                  $filepath,
                  $result->node_title);
          }
          else {          
            $slider_items[$key1]['slide_image'] = 
              '<img src="' . base_path() . $filepath . 
              '" alt="' . $result->node_title . 
              '"/>';     
          }          
        }
        // add slide_text variable
        if (isset($result->node_data_field_slide_text_field_slide_text_value)) {
          $slider_items[$key1]['slide_text'] =  $result->node_data_field_slide_text_field_slide_text_value;
        }
        // add slide_title variable
        if (isset($result->node_title)) {
          $slider_items[$key1]['slide_title'] =  $result->node_title;
        }
        // add slide_read_more variable and slide_node variable
        if (isset($result->nid)) {
          $slider_items[$key1]['slide_read_more'] =  l('Continue', 'node/' . $result->nid);
          $slider_items[$key1]['slide_node'] =  'node/' . $result->nid;
        }
      }
      $vars['slider_items'] = $slider_items;  
    }
 
    if ($vars['settings']['view_name'] == 'news_items') {
      foreach ($vars['content'] as $key1 => $result) {
        // add slide_image variable 
        if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
          // get image id
          $fid = $result->node_data_field_pager_item_text_field_image_fid;
          // get path to image
          $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
          //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
          if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
            $slider_items[$key1]['slide_image'] = 
            theme('imagecache', 
                  $vars['imgcache_slide'], 
                  $filepath,
                  $result->node_title);
          }
          else {          
            $slider_items[$key1]['slide_image'] = 
              '<img src="' . base_path() . $filepath . 
              '" alt="' . $result->node_title . 
              '"/>';     
          }          
        }
        // add slide_text variable
        if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
          $slider_items[$key1]['slide_text'] =  $result->node_data_field_pager_item_text_field_slide_text_value;
        }
        // add slide_title variable
        if (isset($result->node_title)) {
          $slider_items[$key1]['slide_title'] =  $result->node_title;
        }
        // add slide_read_more variable and slide_node variable
        if (isset($result->nid)) {
          $slider_items[$key1]['slide_read_more'] =  l('Continue', 'node/' . $result->nid);
          $slider_items[$key1]['slide_node'] =  'node/' . $result->nid;
        }
      }
      $vars['slider_items'] = $slider_items;  
    } 
 
  }
}  
 
/**
* Display the simple view of rows one after another
*/
function blogbuzz_preprocess_views_view_unformatted(&$vars) {
$view     = $vars['view'];
$rows     = $vars['rows'];
 
$vars['classes'] = array();
// Set up striping values.
foreach ($rows as $id => $row) {
   $vars['classes'][$id] = 'views-row views-row-' . ($id + 1);
   $vars['classes'][$id] .= ' views-row-' . ($id % 2 ? 'even' : 'odd');
   if ($id == 0) {
     $vars['classes'][$id] .= ' views-row-first';
   }
}
$vars['classes'][$id] .= ' views-row-last';
}
 
/**
* Override the search block form so we can change the label
* @return 
* @param $form Object
*/
function phptemplate_search_block_form($form) {
  $output = '';
 
  // the search_block_form element is the search's text field, it also happens to be the form id, so can be confusing
  $form['search_block_form']['#title'] = t('');
 
  $output .= drupal_render($form);
  return $output;
}
 
function blogbuzz_links($links, $attributes = array('class' => 'links')) {
  $output = '';
 
  unset($links['blog_usernames_blog']);
 
  if (count($links) > 0) {
    $output = '<ul'. drupal_attributes($attributes) .'>';
 
    $num_links = count($links);
    $i = 1;
 
    foreach ($links as $key => $link) {
      $class = $key;
 
      // Add first, last and active classes to the list of links to help out themers.
      if ($i == 1) {
        $class .= ' first';
      }
      if ($i == $num_links) {
        $class .= ' last';
      }
      if (isset($link['href']) && $link['href'] == $_GET['q']) {
        $class .= ' active';
      }
      $output .= '<li class="'. $class .'">';
 
      if (isset($link['href'])) {
        // Pass in $link as $options, they share the same keys.
        $link['html'] = TRUE;
        $output .= l('<span>'. check_plain($link['title']) .'</span>', $link['href'], $link);
      }
 
      else if (!empty($link['title'])) {
        // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
        if (empty($link['html'])) {
          $link['title'] = check_plain($link['title']);
        }
        $span_attributes = '';
        if (isset($link['attributes'])) {
          $span_attributes = drupal_attributes($link['attributes']);
        }
        $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>';
      }
 
      $i++;
      $output .= "</li>";
 
      if($attributes['class'] == 'links term-links') {
       $output .= " /";
      }
      $output .= "\n";
    }
 
    $output .= '</ul>';
  }
 
  return $output;
}
 
function blogbuzz_menu_item_link($link) {
  if (empty($link['options'])) {
    $link['options'] = array();
  }
 
  // If an item is a LOCAL TASK, render it as a tab
  if ($link['type'] & MENU_IS_LOCAL_TASK) {
    $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>';
    $link['options']['html'] = TRUE;
  }
 
  if (empty($link['type'])) {
    $true = TRUE;
  }
 
  // Do special stuff for PRIMARY LINKS here
  if ($link['menu_name'] == 'primary-links') {
    $link['title'] = '<span>' . check_plain($link['title']) . '</span>';
    $link['options']['html'] = TRUE;
  }
 
  return l($link['title'], $link['href'], $link['options']);
}
 
/**
 * Converts a string to a suitable html ID attribute.
 *
 * http://www.w3.org/TR/html4/struct/global.html#h-7.5.2 specifies what makes a
 * valid ID attribute in HTML. This function:
 *
 * - Ensure an ID starts with an alpha character by optionally adding an 'id'.
 * - Replaces any character except alphanumeric characters with dashes.
 * - Converts entire string to lowercase.
 *
 * @param $string
 *   The string
 * @return
 *   The converted string
 */
function blogbuzz_id_safe($string) {
  // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
  $string = drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]+/', '-', $string));
  // If the first character is not a-z, add 'id' in front.
  if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.
    $string = 'id' . $string;
  }
  return $string;
}
 
/*
* Override filter.module's theme_filter_tips() function to disable tips display.
*/
function blogbuzz_filter_tips($tips, $long = FALSE, $extra = '') {
  return '';
}
 
function blogbuzz_filter_tips_more_info () {
  return '';
}
 
/*!
 * Dynamic display block preprocess functions
 * Copyright (c) 2008 - 2009 P. Blaauw All rights reserved.
 * Version 1.6 (01-OCT-2009)
 * Licenced under GPL license
 * http://www.gnu.org/licenses/gpl.html
 */
 
 
/**
 * Override or insert variables into the ddblock_cycle_pager_content templates.
 *   Used to convert variables from view_fields  to pager_items template variables
 *  Only used for custom pager items
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 *
 */
function blogbuzz_preprocess_ddblock_cycle_pager_content(&$vars) {
  if (($vars['output_type'] == 'view_fields') && ($vars['pager_settings']['pager'] == 'custom-pager')){
    $content = array();
    // Add pager_items for the template 
    // If you use the devel module uncomment the following lines to see the theme variables
    // dsm($vars['pager_settings']['view_name']);     
    // dsm($vars['content'][0]);     
    // If you don't use the devel module uncomment the following lines to see the theme variables
    // drupal_set_message('<pre>' . var_export($vars['pager_settings'], true) . '</pre>');
    // drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['pager_settings']['view_name'] == 'news_items') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add pager_item_image variable
          if (isset($result->node_data_field_image_field_image_fid)) {
            $fid = $result->node_data_field_image_field_image_fid;
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && 
                is_array(imagecache_presets()) && 
                $vars['imgcache_pager_item'] <> '<none>'){
              $pager_items[$key1]['image'] = 
                theme('imagecache', 
                      $vars['pager_settings']['imgcache_pager_item'],              
                      $filepath,
                      check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value));
            }
            else {          
              $pager_items[$key1]['image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value) . 
                '"/>';     
            }          
          }
          // add pager_item _text variable
          if (isset($result->node_data_field_pager_item_text_field_pager_item_text_value)) {
            $pager_items[$key1]['text'] =  check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value);
          }
        }
      }
    }
    $vars['pager_items'] = $pager_items;
  }    
}
0
0
pentike képe

Te is 6.1-es fordítást telepítettél? Mert szerintem ez nagyobb, mint az előzőek és éppen néhány bájttal lépi át a limitet.

Én most kibővítettem a fordítószkriptet, minden modult egyesével szed be. A fordítási fájlokat a gyökérbe egy hu könyvtárba kell rakni és úgy futtatni a kódot a gyökérből. A po fájlok meglétét/nem létét nem nézi!!

Ez picit hosszú, de úgy látom nem lehet fájlt feltölteni.

include_once 'includes/bootstrap.inc';
include_once 'includes/common.inc';
include_once 'includes/locale.inc';
  $file = (object) array('filepath' => 'hu/aggregator-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/archive-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/block-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/blogapi-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/blog-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/book-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/comment-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/common-inc.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/contact-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/drupal-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/file-inc.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/filter-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/forum-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/general.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/locale-inc.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/locale-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/menu-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/node-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/path-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/poll-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/profile-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/queue-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/search-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/statistics-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/system-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/taxonomy-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/throttle-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/upload-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/user-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  $file = (object) array('filepath' => 'hu/watchdog-module.po');
  _locale_import_po($file, 'hu', 'overwrite');
  header('Location: index.php');
  exit();
0
0