Views pager

Marci képe

Csináltam egy blogbejegyzéseket megjelenítő nézetet. A fejlécében megjelenítettem a blogger modul által generált táblázatot az alábbi blogger.module fájlból kihalászott kóddal:

<?php {    
  $maxdisp  = 25;	
  $shownum  = variable_get("blogger_shownum", 0);  
  $blogger_order  = variable_get("blogger_order", 0); 
  $blogger_case   = variable_get("blogger_case", 0); 
  $blogger_avatar = variable_get("blogger_avatar", 0); 
  $blogger_avatar_width = variable_get("blogger_avatar_width", 0);
  $blogger_avatar_height = variable_get("blogger_avatar_height", 0);
 
gyuri2012 képe

<div id="wrapper">
</div>
<div id="overlay" style="width: 1280px; z-index: 10090; height: 740px; background-color: rgb(0, 0, 0); opacity: 0.8;"/>
<div id="lightbox" style="z-index: 10500; top: 261.3px; left: 0px; display: block;">
<div id="outerImageContainer" style="background-color: rgb(255, 255, 255); color: rgb(255, 255, 255); width: 512px; display: block; height: 384px;">
<div id="modalContainer" style="padding: 0px; display: none;"/>
<div id="frameContainer" style="padding: 0px; display: none;">
<iframe id="lightboxFrame" style="display: none;">
<html>
<head>
<title/>
</head>
<body/>
</html>
</iframe>
</div>
<div id="imageContainer" style="padding: 0px;">
<img id="lightboxImage" style="display: inline; width: 512px; height: 384px; z-index: 10500;" src="http://www.kulcsiturul.hu/system/files/images/Reka_szoba3.JPG" alt="Reka_szoba3<br /><a href="/kepek/rekaszoba3" id="node_link_text" >View Image Details</a>"/>
<div id="bottomNav" style="float: left;">
<a id="bottomNavClose" href="#" style="background-color: rgb(255, 255, 255); color: rgb(255, 255, 255);"/>
<a id="bottomNavZoom" href="#" style="display: none;"/>
<a id="bottomNavZoomOut" href="#" style="display: none;"/>
</div>
</div>
<div id="loading" style="z-index: 10500; display: none;">
<a id="loadingLink" href="#"/>
</div>
</div>
<div id="imageDataContainer" class="clearfix" style="background-color: rgb(255, 255, 255); color: rgb(255, 255, 255); display: block; width: 512px;">
<div id="imageData">
<div id="hoverNav" style="display: block; z-index: 10500;">
<a id="prevLink" href="#" style="padding-top: 0px; display: none;"/>
<a id="nextLink" href="#" style="padding-top: 0px; display: none;"/>
</div>
<div id="imageDetails">
<span id="caption" style="z-index: 10500;">
Reka_szoba3
<br/>
<a id="node_link_text" href="/kepek/rekaszoba3">View Image Details</a>
</span>
<span id="numberDisplay" style="display: none;"/>
<a id="lightshowPause" style="display: none;" href="#"/>
<a id="lightshowPlay" style="display: none;" href="#"/>
</div>

Azaz nincs [valami], de egy kép megnézése működik... Olvastam én is valahol, gondolom Lightbox README-jében []-t, csak nem tudom összeegyeztetni a sajátommal...

Maga az oldal forrása, mielött Lightboxal megnyitnék egy képet:

<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/lightbox2/css/lightbox_alt.css?r" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?r" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/greenNblack/style.css?r" />
 
<script type="text/javascript" src="/misc/jquery.js?r"></script>
<script type="text/javascript" src="/misc/drupal.js?r"></script>
<script type="text/javascript" src="/sites/default/files/languages/hu_8582a244f490b74610256ab428690e24.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/date/date_timezone/date_timezone.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/auto_image_handling.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox.js?r"></script>
<script type="text/javascript">jQuery.extend(Drupal.settings, { "basePath": "/", "lightbox2": { "rtl": "0", "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": "0", "font_color": "ffffff", "box_color": "ffffff", "top_position": "", "overlay_opacity": "0.8", "overlay_color": "000", "resize_sequence": "0", "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 400, "use_alt_layout": 1, "disable_resize": 0, "disable_zoom": 0, "force_show_nav": 0, "loop_items": 1, "node_link_text": "View Image Details", "node_link_target": 0, "image_count": "", "page_count": "", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "display_image_size": "", "image_node_sizes": "(\\.thumbnail)", "trigger_lightbox_classes": "img.thumbnail, img.image-thumbnail", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": 0, "custom_trigger_classes": "", "disable_for_gallery_lists": 0, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_exit": 1, "show_play_pause": 1, "pause_on_next_click": 0, "pause_on_previous_click": true, "loop_slides": 1, "iframe_width": "600", "iframe_height": "400", "iframe_border": 1, "enable_video": 0 } });</script>
.
.
.
      <div class="view-content">
      <table class="views-view-grid">
  <tbody>
                <tr class="row-1 row-first">
 
                  <td class="col-1">
              <div class="node">
 
      <div class="content clear-block">
    <a href="/kepek/rekaszoba"><img src="http://www.kulcsiturul.hu/system/files/images/Reka_szoba.thumbnail.JPG" alt="Reka_szoba" title="Reka_szoba"  class="image image-thumbnail " width="200" height="150" /></a>  </div>
 
  </div>
.
.
.

Bocs hogy ilyen sokat másoltam...
Ha nem megy így, akkor bekapcsolom az oldalt (ezt még szeretném megcsinálni mielőtt bekapcsolom..., már fent van a helyén), úgy biztos sokkal egyszerűbb lenne...
0
0
Hojtsy Gábor képe

A drupal.org-on ezt egy spéci form_alter-rel oldottuk meg. Drupal 5 kód, mivel neked az kell:

/**
 * Implementation of hook_form_alter().
 */
function drupalorg_form_alter($form_id, &$form) {
  // ...
  if ($form_id == 'user_edit') {
    // ...
    if (isset($form['Personal information']['profile_languages'])) {
      $form['Personal information']['profile_languages']['#multiple'] = TRUE;
      $form['Personal information']['profile_languages']['#default_value'] = explode('; ', $form['Personal information']['profile_languages']['#default_value']);
      $form['#validate']['drupalorg_profile_fix_languages'] = array();
    }
  }
  // ...
}
 
/**
 * Validation handler for the user profile form, to serialize languages to a string.
 */
function drupalorg_profile_fix_languages($form_id, $form_values, $form) {
  if (is_array($form_values['profile_languages'])) {
    form_set_value($form['Personal information']['profile_languages'], join('; ', array_keys($form_values['profile_languages'])));
  }
}

A lényeg, hogy a profile modul csak egy kiválasztós mezőt tud támogatni. Ezért úgy kell tenni, mintha egy kiválasztós mezőnk lenne. Programból írjuk ezt át több kiválasztósra, de ugyanúgy egy karaktersorozatban tároljuk a kiválasztott értékeket, csak pontosvesszővel választjuk el. Mivel ezt a Drupal nem értené, ezért fel kell darabolni annak alapján, a mentés előtt pedig össze kell illeszteni. Így a Drupal úgy gondolja, hogy egy választós mezőt használsz, pedig nem :)

Teljes modul kód Drupal 5-re (rengeteg mással) itt: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/drupalorg/d...

Drupal 6-ra itt: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/drupalorg/d...

Drupal 6 kód kimásolva:

/**
 * Implementation of hook_form_alter().
 */
function drupalorg_form_alter(&$form, $form_state, $form_id) {
  // ...
  if ($form_id == 'user_profile_form') {
    // ...
    // Hack to make the language list a multiselect field (there is no UI
    // for this in profile module). We need to hack around that profile only
    // ever stores select field values as strings, so we need to explode what
    // was in there for our multiselect form.
    if (isset($form['Personal information']['profile_languages'])) {
      $form['Personal information']['profile_languages']['#multiple'] = TRUE;
      $form['Personal information']['profile_languages']['#default_value'] = explode('; ', $form['Personal information']['profile_languages']['#default_value']);
      $form['#submit'] = array_merge(array('drupalorg_profile_fix_languages'), $form['#submit']);
    }
  }
}
 
/**
 * Submit handler for the user profile form, to serialize languages to a string.
 */
function drupalorg_profile_fix_languages(&$form, &$form_state) {
  if (is_array($form_state['values']['profile_languages'])) {
    $form_state['values']['profile_languages'] = join('; ', array_keys($form_state['values']['profile_languages']));
  }
}
0
0
szantog képe

Nya, akkor php + mysql elő, és íme a drupal körítés:
Na tolok még egy pár
sort,
hogy
az avatarom alá kerüljön a kód.

//kell egy hook_block, amivel megasszongyuk drupalnak, hogy kell egy saját blokk
/**
 * Implementation of hook_block().
 *
 * @param $op What kind of information to retrieve about the block. Possible values: list, configure, save, view.
 * @param $delta Which block to return.
 * @param $edit Data from a configuration form, if submitted.
 */
function MODULKÁM_block($op = 'list', $delta = 0, $edit = array()) {
  switch($op) {
    case 'list':
      $blocks = array();
      $blocks['0'] = array(
        'info' => t('Egy english cím a blokk oldalra'),
      );
 
      return $blocks;
      break;
 
    case 'view':
      $blocks = array();
      switch($delta) {
        case '0':
          $block['subject'] = t('English cím, ami a blokk cím lesz');
          break;
      }
      $block['content'] = MODULKÁM_block_content($delta);
 
      return $block;
      break;
  }
}
 
/**
 * Generate block contents.
 *
 * @param $delta The block id.
 * @return The generated block content.
 */
function MODULKÁM_block_content($delta) {
  switch($delta) {
    case '0':  
      //Ezt a sminkfüggvényt lentebb fogjuk deklarálni
      return theme('MODULKÁM_db_counter_text');
      break;
  }
}
 
/**
 * Ez itt maga a számokat összegyűjtő, előállító függvény, mint látod, én is termekhez tartozó node-okat számolok vele össze, mégpedig egy adott node típust.
 *
 * @param $tid the term id to filter
 * @return the number of nodes
 */
function MODULKÁM_node_counter($tid = NULL) {
  if (!is_null($tid)) {
    $query = "SELECT COUNT(1) as count FROM {node} n INNER JOIN {term_node} t ON n.vid = t.vid WHERE ((t.tid = %d) & (n.type = '%s'))";
    $result = db_query($query, $tid, '[ez itt a nodetype]');
  }
  else {
    $query = "SELECT COUNT(1) as count FROM {node} WHERE type = '%s'";
    $result = db_query($query, '[ez itt a nodetype]');
  }
 
  $counter = db_fetch_array($result);
 
  return $counter['count'];
 
}
 
/**
 * Ez egy sminkfüggvény definíciója, hogy ne hányjuk tele a modul   működési logikáját divekkel + egyéb szemetekkel.
 * Implementation of hook_theme().
 */
function MODULKÁM_theme() {
  return array(
    'MODULKÁM_db_counter_text' => array(
      'arguments' => array(),
    ),
  );
}
 
/*
 * Ez meg itt maga a sminkfüggvény, ami tképpen nem is igazi sminkfüggvény, de ezt még nem lehet tudni, hogy később milyen html köret kell esetleg a cucchoz.
 * Simple theme function for database counter block.
 */
function theme_MODULKÁM_db_counter_text() {
  $output = t('We currently feature !count-all suppliers from Central Europe, including !count_russia suppliers from Russia, !count_czech suppliers from the Czech Republic, !count_hun suppliers from Hungary, !count_pol from Poland, !count_slovak from Slovakia, !count_sloven from Slovenia and more...'
    , array ('!count-all' => MODULKÁM_node_counter(), '!count_russia' => MODULKÁM_node_counter(2929), '!count_czech' => MODULKÁM_node_counter(2802), '!count_hun' => MODULKÁM_node_counter(2843), '!count_pol' => MODULKÁM_node_counter(2919), '!count_slovak' => MODULKÁM_node_counter(2940), '!count_sloven' => MODULKÁM_node_counter(2938)));
  return $output;
}
3
0

----
Rájöttem, miért kérdezek olyan ritkán a drupal.hu-n. Amíg szedem össze az infokat a kérdéshez, mindig rájövök a megoldásra.

views order hiba?

gdavid képe

Van egy helyes kis views-om, ami kivalogatja par szamomra fontos tartalom kozul azokat amik frissek, vagy van hozzajuk uj comment.

a gond az, hogy bar a views-ban be van allitva, hogy a rendezes last_comment_time desc legyen, megis a query-t asc kent rendezi.

kiexportaltam:
bocs, kicsit hosszu lett:

$view = new view;
$view->name = 'forum_top';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
Drupal verzió: 
Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
aboros képe

véletlenül pont volt egy ilyen példa a játszóterembe :)

$view = new view;
$view->name = 'newcontent';
$view->description = 'Shows all new activity on system.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'type' => array(
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'label' => 'Type',
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'label' => 'Title',
    'link_to_node' => TRUE,
  ),
  'name' => array(
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'label' => 'Author',
    'link_to_user' => TRUE,
  ),
  'comment_count' => array(
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
    'label' => 'Replies',
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
  ),
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'label' => 'Last Post',
    'date_format' => 'small',
    'custom_date_format' => '',
  ),
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'history_user',
    'field' => 'timestamp',
    'label' => '',
    'comments' => 1,
    'relationship' => 'none',
    'link_to_node' => 0,
    'comment' => 1,
  ),
  'new_comments' => array(
    'id' => 'new_comments',
    'table' => 'node',
    'field' => 'new_comments',
    'label' => '',
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => ' new',
    'link_to_comment' => 1,
    'no_empty' => 1,
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'order' => 'ASC',
    'granularity' => 'second',
  ),
));
$handler->override_option('arguments', array(
  'uid_touch' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => TRUE,
      'override' => FALSE,
      'items_per_page' => 25,
    ),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'current_user',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'id' => 'uid_touch',
    'table' => 'node',
    'field' => 'uid_touch',
    'relationship' => 'none',
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_php' => '',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
    ),
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'operator' => '=',
    'value' => '1',
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'status' => array(
      'id' => 'status',
      'table' => 'comments',
      'field' => 'status',
      'operator' => '=',
      'value' => 0,
      'group' => 0,
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'relationship' => 'none',
    ),
  ),
  'timestamp' => array(
    'operator' => '=',
    'value' => '',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'timestamp',
    'table' => 'history_user',
    'field' => 'timestamp',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'role',
  'role' => array(
    '2' => 2,
  ),
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'New content since your last login');
$handler->override_option('items_per_page', '25');
$handler->override_option('use_pager', TRUE);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'override' => 1,
  'order' => 'desc',
  'columns' => array(
    'type' => 'type',
    'title' => 'title',
    'name' => 'name',
    'comment_count' => 'comment_count',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'timestamp' => 'title',
    'new_comments' => 'comment_count',
  ),
  'info' => array(
    'type' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 1,
      'separator' => '&nbsp;',
    ),
    'name' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'comment_count' => array(
      'sortable' => 1,
      'separator' => '<br />',
    ),
    'last_comment_timestamp' => array(
      'sortable' => 1,
      'separator' => '&nbsp;',
    ),
    'timestamp' => array(
      'separator' => '',
    ),
    'new_comments' => array(
      'separator' => '',
    ),
  ),
  'default' => 'last_comment_timestamp',
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'new-content');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'New Content',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => NULL,
  'description' => '',
  'weight' => NULL,
  'name' => 'navigation',
));

beimportálod viewsba, létrejön egy "newcontent" nevű nézet. ez egy page megjelenítőt készít, a navigation menübe egy menüpontot is rak ami erre mutat, a menüpont neve "New Content". csak olyan tartalmakat mutat, amikre igaz:
(szerzője az aktuális user VAGY kommentelt rá) ÉS van új tartalom a legutolsó megtekintés óta

biztos nem tökéletesen pontosan azt csinálja amit szeretnél, de gyors volt :) és az elvet szépen mutatja, végülis pont ezt az argumentumot és szűrőket kell használnod minden mást alakíthatsz ahogy akarsz.

1
0

-
clear: both;

HF leon képe

Hogy jönnek a régiókhoz ezek a block-block id-k?

Nézzük mondjuk a Bartik page.tpl.php fájlt. Ebben a Header régiót a következő parancs írja ki:

  1. <?php print render($page['header']); ?>

A régiók mindíg a page.tpl.php fájlban vannak. Ez a fájl definiálja az oldal alapszerkezetét. Amiket írtál "Logó, a Honlapnév és a Jelmondat" az a page.tpl.php fájl id="header" div-ében vannak. Ebbe generálódik a ['header'] régió is.

Alább ez a div van:

  1. <div id="header" class="<?php print $secondary_menu ? 'with-secondary-menu': 'without-secondary-menu'; ?>"><div class="section clearfix">
  2.  
  3. <?php if ($logo): ?>
  4. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
  5. <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
  6. </a>
  7. <?php endif; ?>
  8.  
  9. <?php if ($site_name || $site_slogan): ?>
  10. <div id="name-and-slogan"<?php if ($hide_site_name && $hide_site_slogan) { print ' class="element-invisible"'; } ?>>
  11.  
  12. <?php if ($site_name): ?>
  13. <?php if ($title): ?>
  14. <div id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
  15. <strong>
  16. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
  17. </strong>
  18. </div>
  19. <?php else: /* Use h1 when the content title is empty */ ?>
  20. <h1 id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
  21. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
  22. </h1>
  23. <?php endif; ?>
  24. <?php endif; ?>
  25.  
  26. <?php if ($site_slogan): ?>
  27. <div id="site-slogan"<?php if ($hide_site_slogan) { print ' class="element-invisible"'; } ?>>
  28. <?php print $site_slogan; ?>
  29. </div>
  30. <?php endif; ?>
  31.  
  32. </div> <!-- /#name-and-slogan -->
  33. <?php endif; ?>
  34.  
  35. <?php print render($page['header']); ?>
  36.  
  37. <?php if ($main_menu): ?>
  38. <div id="main-menu" class="navigation">
  39. <?php print theme('links__system_main_menu', array(
  40. 'links' => $main_menu,
  41. 'attributes' => array(
  42. 'id' => 'main-menu-links',
  43. 'class' => array('links', 'clearfix'),
  44. ),
  45. 'heading' => array(
  46. 'text' => t('Main menu'),
  47. 'level' => 'h2',
  48. 'class' => array('element-invisible'),
  49. ),
  50. )); ?>
  51. </div> <!-- /#main-menu -->
  52. <?php endif; ?>
  53.  
  54. <?php if ($secondary_menu): ?>
  55. <div id="secondary-menu" class="navigation">
  56. <?php print theme('links__system_secondary_menu', array(
  57. 'links' => $secondary_menu,
  58. 'attributes' => array(
  59. 'id' => 'secondary-menu-links',
  60. 'class' => array('links', 'inline', 'clearfix'),
  61. ),
  62. 'heading' => array(
  63. 'text' => t('Secondary menu'),
  64. 'level' => 'h2',
  65. 'class' => array('element-invisible'),
  66. ),
  67. )); ?>
  68. </div> <!-- /#secondary-menu -->
  69. <?php endif; ?>
  70.  
  71. </div>
0
0
gyusza képe

require("mailkuldes.php");
	function chk() {
	$GLOBALS['msg']="";
	$_POST['nev']=strip_tags($_POST['nev']);
	$_POST['email']=strip_tags($_POST['email']);
	$_POST['telefon']=strip_tags($_POST['telefon']);
	$_POST['lakcim']=strip_tags($_POST['lakcim']);
	$_POST['szamlacim']=strip_tags($_POST['szamlacim']);
	$_POST['levelcim']=strip_tags($_POST['levelcim']);
	$_POST['kapcsnev']=strip_tags($_POST['kapcsnev']);
	$_POST['kapcscim']=strip_tags($_POST['kapcscim']);
	$_POST['kapcsemail']=strip_tags($_POST['kapcsemail']);
	$_POST['kapcstelefon']=strip_tags($_POST['kapcstelefon']);
	$_POST['uzenet']=htmlspecialchars(strip_tags($_POST['uzenet']));
	if (empty($_POST['nev'])) $GLOBALS['msg'].="<li>Mindenképpen adja meg a nevét!<br>";
	if (empty($_POST['email']) || !eregi("^[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]",$_POST['email'])) $GLOBALS['msg'].="<li>A megadott E-mail cím (".$_POST['email'].") nem t&#369;nik valós E-mail címnek!";
	return empty($GLOBALS['msg']);
	}
if (isset($_GET['kuldes']) && $_GET['kuldes'] == "ok") {
	$cimzett="[email protected]";
	$tema="Megrendelés/üzenet érkezett";
$tartalom= '
Tulaj: '.$_POST['nev'].'
Lakcím (vagy székhely): '.$_POST['lakcim'].'
Email: '.$_POST['email'].'
Telefon: '.$_POST['telefon'].'
Kapcsolattartó: '.$_POST['kapcsnev'].'
Kapcsolattartó lakcíme: '.$_POST['kapcscim'].'
Kapcsolattartó E-mail címe: '.$_POST['kapcsemail'].'
Kapcsolattartó telefon száma: '.$_POST['kapcstelefon'].'
Számlázási cím: '.$_POST['szamlacim'].'
Levelezési cím: '.$_POST['levelcim'].'
Egyéb megjegyzés, üzenet: '.$_POST['uzenet'].'
';
	$kuldoNeve	= $_POST['nev'];
	$kuldoEmailCime	= $_POST['email'];
	levelKuldes($cimzett,$tema,$tartalom,$kuldoNeve,$kuldoEmailCime);// a valtozok atnevezhetoek csak a beszedessseg miatt adtam ezeket viszont a fuggvenynek pontosan ennyi parametert kell megadni es a sorrendet sem szabad felcserelni. Tehat elso a cimzett akinek a levelet kuldeni szeretnetek a masodik a tema utana tartalom aztan a kuldon neve (pl.: Kis János) majd az email cime([email protected]) ide valos mailcimet kell megadni hogy a spamszurokon atmenjen a mail, ha nincs valos kuldo akkor allitsatok be egy meglevo email cimet.
	$GLOBALS['uzi']=true;
}
0
0
Sweetchuck képe

és egy mini modult is tudsz hozzá fejleszteni, ami a poll-hoz hozzáadja a body-t...

pollbody.info

; $Id$
name           = "Poll body"
description    = "Add body field to poll content type."
package        = "Other"
dependencies[] = poll
version        = "6.x-1.0-dev"
project        = "pollbody"
core           = 6.x

bollbody.module

// $Id$
 
/**
 * @file
 *    Add body field to poll content type.
 */
 
/**
 * Implementation of hook_form_alter().
 */
function pollbody_form_alter(&$form, $form_state, $form_id) {
  if ( $form_id == 'poll_node_form') {
    //Nem jó, akkor sem ha az admin felületen ki van töltve.
    //$type = node_get_types('type', $node);
    //$body_label = $type->body_label;
    $body_label = t('Body');
 
    $body = '';
    $body_format = FILTER_FORMAT_DEFAULT;
    if (isset($form_state['values'])) {      
      $body = $form_state['values']['body'];
      $body_format = $form['values']['format'];
    }
    else if (isset($form['#node']->pollbody)) {
      $body = $form['#node']->pollbody['body'];
      $body_format = $form['#node']->pollbody['format'];
    }
 
    $form['body_field'] = node_body_field($form['#node'], $body_label, 0);
    $form['body_field']['#weight'] = -4;
    $form['body_field']['body']['#default_value'] = $body;
    $form['body_field']['format']['#default_value'] = $body_format;
  }
}
 
/**
 * Implementation of hook_nodeapi().
 */
function pollbody_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($node->type != 'poll') return;
 
  switch ( $op ) {
    case 'view' :
      $body = '';
      $body_format = FILTER_FORMAT_DEFAULT;
      if (isset($node->body)) {
        //előnézet esetén
        $body = $node->body;
        $body_format = $node->format;
      }
      else {
        if ( !isset($node->pollbody) ) {
          _pollbody_nodeapi_load($node);
        }
        $body = $node->pollbody['body'];
        $body_format = $node->pollbody['format'];
      }
 
      if ( !$a3 ) {
        $node->content['pollbody']['body']['#value'] = check_markup($body, $body_format);
      }
      break;
 
    case 'load' :
      _pollbody_nodeapi_load($node);
      break;
 
  }
}
 
function _pollbody_nodeapi_load(&$node) {
  $node->pollbody = db_fetch_array(db_query("SELECT body, format FROM {node_revisions} WHERE vid = '%d'", $node->vid));
}

Persze ez is egy újabb modul.

0
0
aboros képe

miért a node_images -t választottad? valami konkrét oka van?

használd inkább a cck imagefield -et és akkor a lightbox2 field formattert ki tudod választani a 'display fields' részben egy lehulló listából két kattintással.

vagy ha mégis a node_images -nél akarsz maradni:
node_images.module -ban van egy sminkfüggvény, ami a csatolt képek html kimenetét állítja elő theme_node_images_view a neve, ezt kompletten lemásolod és beilleszted a sminked mappájában lévő template.php fileba. (ha nincs ilyen, hozzad létre) átnevezed a függvényt SMINKEDNEVE_node_images_view -ra ezután kedvedre babrálhatod, például így (az én sminkem neve: playground)

/**
 * Show node images in the node view.
 */
function playground_node_images_view($node, $teaser, $page, $block = FALSE, $count = NULL, $format = NULL) {
  if (arg(2) == 'image_gallery' || empty($node->node_images)) return;
 
  $output = '';
  $i = 0;
 
  // set maximum number of images for teaser/body
  $view = ($teaser ? 'teaser' : 'body');
  if (!$count) {
    $count = variable_get('node_images_'.$view.'_images_'.$node->type, 2);
  }
  if (isset($count) && $count == '0') return;
 
  // set image format
  if (!$format) {
    $format = variable_get('node_images_'.$view.'_format_'.$node->type, 'thumbs');
  }
 
  foreach((array)$node->node_images as $id => $image) {
    $description = check_plain($image->description);
    $pattern = '<img src="%path" alt="%description" />';
    $thumb = strtr($pattern, array('%path'=>file_create_url($image->thumbpath), '%description'=>$description));
    $fullsize = strtr($pattern, array('%path'=>file_create_url($image->filepath), '%description'=>$description));
 
    if ($info = @getimagesize($image->filepath)) {
      $width = $info[0] + 36;
      $height = $info[1] + 36;
    }
    else {
      $width = 420;
      $height = 315;
    }
 
    if ($format == 'thumbs') {
/**
* figyelj, itt jön a változás
*/
      $output .= '<a href="'.file_create_url($image->filepath).'" title="'.$description.'" rel="lightbox['.$node->nid.']['.$description.']">'.$thumb.'</a> ';
    }
    else {
      $output .= $fullsize.' ';
    }
    if ($count>0 && ++$i >= $count) break;
  }
 
  if ($block && $count < count($node->node_images)) {
    $output .= '<div class="node_images_block_link">'.l(t('View all images'), 'node/'.$node->nid.'/image_gallery').'</div>';
  }
 
  return $output;
}
0
0

-
clear: both;