makgab képe

A neten talált infók alapján ezt találtam ki:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id === 'user_register_form') {
    // $form['account']['name']['#title'] = t('Full name');
    $form['rid'] = array(
        '#type' => 'hidden',
        '#markup' => isset($_GET['rid'])? $_GET['rid'] : '',
        );
    // validate and submit
    // $form['#validate'][] = 'mymodule_user_register_validate';
    $form['#submit'][] = 'mymodule_user_register_submit';
  }
}

A rejtett mezőbe tenné a rid értékét.

Az eredeti user_register_submit() lefutása után ez is lefut(?):

function mymodule_user_register_submit(&$form, &$form_state) {
  global $user;
 
  $rid = $form_state['values']['rid'];
  // SQL INSERT with variable $rid
  $res = db_query( "INSERT INTO {mymodule_mytable} (rid,uid) VALUES(:rid,:uid)", array(':rid' => $rid, ':uid' => $user->uid ) );
  if ( $res ) {
  //...
}

Jó irányba keresgélek? Vagy h@@@@ség?

0
0
simont képe

Kicsit utánanéztem, ezt találtam. A sortörés probléma a 36 tól frissebb Firefoxnál jön elő.
2 megoldás van:

1.megoldás: \sites\all\modules\ckeditor\ckeditor\skins\moono\editor_gecko.css fájlban átírod ezt:

  1. .cke_source{
  2. font-family:'Courier New',Monospace;
  3. font-size:small;
  4. background-color:#fff;
  5. white-space:pre
  6. }

erre:
  1. .cke_source{
  2. font-family:'Courier New',Monospace;
  3. font-size:small;
  4. background-color:#fff;
  5. white-space:pre-wrap
  6. }


2.megoldás: a használt sminkek css fájljába beírod ezt:
  1. .cke_source {
  2. white-space: pre-wrap !important;
  3. }


Nálam működik. Nyilván ha több sminket használsz, akkor az első megoldás a nyerő.
2
0

SimonT

XForum konverzió

Pál úr képe

Üdv,

Hosszas kutakodás eredménye képpen arra jutottam, hogy a korábban beüzemelt, PostNuke 0.708 alapú portál XForum (1.81.1-es verzió) adatainak konverzióját nem lesz könnyű megoldani. Erre utalt a drupal.org alábbi fórumszála is.

Nem lévén más megoldás, egy kis php-szkriptet írtam hozzá, mely -- eddigi tapasztalataim szerint -- szépen áthozott minden adatot. Csak annyit tudok megjegyezni róla, hogy nálam minden adat a helyére került, mindenki használja backup-olás után egészséggel.

Feeds import

black71 képe

Következő probléma megoldására kérek/keresek megoldást.
Feeds -el szeretnék node -kat importálni 1node importhoz 2db csv file van.
A csv fájlokban az azonosítót (id) leszámítva az oszlopok és mezők értékei eltérőek.
Feeds -ben készítettem két sablont az importhoz "Node processor" -al. Az azonosító mezőnek mind a két esetben GIUD érték van beállítva, és ennek ellenére az importok külön node -kat készítenek a frissítés helyet.
Mit csinálok rosszul?
export 1:

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

Ez a phptemplate_ kezdetű függvény-override elavult, ne használd.

Az általad belinkelt issue-ban az illető a
theme_uc_catalog_product_grid()
függvényt bírálja felül a saját sminkben, de az elavult phptemplate kezdetű függvény-override-ot használja. A theme részt a függvény nevében a sminked nevére kellene inkább lecserélni. Például ha a sminked neve "sminkem" (ami magának a theme-nek a könyvtárneve is), akkor ez lesz a függvénynév: sminkem_uc_catalog_product_grid (a theme_uc_catalog_product_grid helyett).
Az ő kódja alapján írtam le a következőket, én még nem használtam a modult, de remélem, menni fog így távirányítással.

Lépések:

  1. az aktív sminked template.php fájlját nyisd meg a kedvenc egyszerű szövegszerkesztődben (pl. Notepad++)
  2. Másold bele egy az egyben a következő függvényt:

    1. /**
    2.  * Display a list of products in grid format().
    3.  *
    4.  * Override theme_uc_catalog_product_grid function from uc_catalog module
    5.  * @ingroup themeable
    6.  */
    7. function SMINKEDNEVE_uc_catalog_product_grid($products) {
    8. $product_table = '<div class="category-grid-products"><table>';
    9. $count = 0;
    10. $context = array(
    11. 'revision' => 'themed',
    12. 'type' => 'product',
    13. );
    14. foreach ($products as $nid) {
    15. $product = node_load($nid);
    16. $context['subject'] = array('node' => $product);
    17.  
    18. if ($count == 0) {
    19. $product_table .= '<tr>';
    20. }
    21. elseif ($count % variable_get('uc_catalog_grid_display_width', 3) == 0) {
    22. $product_table .= '</tr><tr>';
    23. }
    24.  
    25. $titlelink = l($product->title, "node/$nid", array('html' => TRUE));
    26. if (module_exists('imagecache') && ($field = variable_get('uc_image_'. $product->type, '')) && isset($product->$field) && file_exists($product->{$field}[0]['filepath'])) {
    27. $imagelink = l(theme('imagecache', 'product_list', $product->{$field}[0]['filepath'], $product->title, $product->title), "node/$nid", array('html' => TRUE));
    28. }
    29. else {
    30. $imagelink = '';
    31. }
    32.  
    33. $product_table .= '<td>';
    34. if (variable_get('uc_catalog_grid_display_title', TRUE)) {
    35. $product_table .= '<span class="catalog-grid-title">'. $titlelink .'</span>';
    36. }
    37. if (variable_get('uc_catalog_grid_display_model', TRUE)) {
    38. $product_table .= '<span class="catalog-grid-ref">'. $product->model .'</span>';
    39. }
    40. $product_table .= '<span class="catalog-grid-image">'. $imagelink .'</span>';
    41. if (module_exists('uc_discounts')) {
    42. $discounted_price = theme("get_discounted_price", $product);
    43. if (!is_null($discounted_price) && $product->sell_price > $discounted_price) {
    44. if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
    45. $product_table .= '<p class="original-sell-price">'. uc_price($product->sell_price, $context) .'</p>';
    46. }
    47. $product_table .= '<span class="field-type-discounted-price">'. theme("product_discounted_price", $product, uc_price($discounted_price, $context)) .'</span>';
    48. }
    49. else {
    50. if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
    51. $product_table .= '<span class="catalog-grid-sell-price">'. uc_price($product->sell_price, $context) .'</span>';
    52. }
    53. }
    54. theme('add_product_price_altering_css', $product);
    55. theme('add_product_price_altering_javascript', $product);
    56. }
    57. else {
    58. if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
    59. $product_table .= '<span class="catalog-grid-sell-price">'. uc_price($product->sell_price, $context) .'</span>';
    60. }
    61. }
    62.  
    63. if (module_exists('uc_cart') && variable_get('uc_catalog_grid_display_add_to_cart', TRUE)) {
    64. if (variable_get('uc_catalog_grid_display_attributes', TRUE)) {
    65. $product_table .= theme('uc_product_add_to_cart', $product);
    66. }
    67. else {
    68. $product_table .= drupal_get_form('uc_catalog_buy_it_now_form_'. $product->nid, $product);
    69. }
    70. }
    71. $product_table .= '</td>';
    72.  
    73. $count++;
    74. }
    75. $product_table .= '</tr></table></div>';
    76. return $product_table;
    77. }
  3. Cseréld le a SMINKEDNEVE részt a saját sminked nevére (machine name-jére, ami a könyvtárneve is)!
  4. Ürítsd a cache-t, és próbáld ki.
  5. Jelezz vissza, hogy sikerrel jártál-e. :)
1
0
aboros képe

elvileg ezt be tudod importálni szépen, semmi egyedi mező nem lesz benne, ami miatt reklamálnia kéne.

az a titok, hogy a relationshipbe fel kell venni a node: votes és korlátozni az aktuális userre, aztán pedig kell egy filter, ami ezt az előbbi relationshipet használja, votes: value, és is NULL.. tadaa.. ;)

$view = new view;
$view->name = 'voteless';
$view->description = 'Nodes which are not yet rated by the current user.';
$view->tag = '';
$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('relationships', array(
  'votingapi_vote' => array(
    'label' => 'Votes',
    'required' => 0,
    'votingapi' => array(
      'value_type' => '',
      'tag' => 'vote',
    ),
    'current_user' => TRUE,
    'id' => 'votingapi_vote',
    'table' => 'node',
    'field' => 'votingapi_vote',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'value' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'set_precision' => 0,
    'precision' => '0',
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'appearance' => 'fivestar_views_value_display_handler',
    'exclude' => 0,
    'id' => 'value',
    'table' => 'votingapi_vote',
    'field' => 'value',
    'relationship' => 'votingapi_vote',
  ),
));
$handler->override_option('filters', array(
  'value' => array(
    'operator' => 'empty',
    'value' => array(
      'value' => '',
      'min' => '',
      'max' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'value',
    'table' => 'votingapi_vote',
    'field' => 'value',
    'relationship' => 'votingapi_vote',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));

több userrel nem próbáltam, de egy userre szépen működött a játszótéren, remekül visszadta azt az egy nodeot, amire egyátalán nem szavaztam. szerintem több userre is simán fog működni, azért kell korlátozni a relationshipet, hogy csak current user játszik.

0
0

-
clear: both;

xmarket képe

Üdv!

Hát sajna nem... Apache 2.2.10, php 5.2.8, mysql 5.0.72. A D7 telepítésnél meg ott akadok meg amikor a telepítés uccsó lépéseként megkérdezi, hogy mi legyen az user/1 felhasználóneve jelszava. Mármint azon az oldalon.. Adatbázisra rá tud csatlakozni. Amikor leklikkelem a mentés gombot akkor egy üres oldalt kapok vissza, és nem tudok tovább menni :S Utánanézek, hogy mi is a gond, és commit-olom ide :D Hátha ti többet tudtok nekem mondani.. A rewrite engedélyezve lett, és automatikusan engedélyezi a minimal telepítés uccsó lépésénél.. Meglehet hogy ez nem tetszik neki még nem próbáltam..

Itt akad el: http://www.drupal7.hu/install.php?locale=&profile=expert

php_error_log:

[29-Dec-2008 13:58:48] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SELECT 1 FROM {blocked_ips} WHERE ip =
Array
(
    [:ip] => 10.10.10.253
)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.blocked_ips' doesn't exist' in /var/www/drupal/includes/datab
Stack trace:
#0 /var/www/drupal/includes/database/database.inc(1609): DatabaseConnection->query('SELECT 1 FROM {...', Array, Array)
#1 /var/www/drupal/includes/bootstrap.inc(1018): db_query('SELECT 1 FROM {...', Array)
#2 /var/www/drupal/includes/bootstrap.inc(1120): drupal_is_denied('10.10.10.253')
#3 /var/www/drupal/includes/bootstrap.inc(1065): _drupal_bootstrap(3)
#4 /var/www/drupal/index.php(21): drupal_bootstrap(9)
#5 {main}
  thrown in /var/www/drupal/includes/database/database.inc on line 509
[29-Dec-2008 13:58:51] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SELECT 1 FROM {blocked_ips} WHERE ip =
Array
(
    [:ip] => 10.10.10.253
)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.blocked_ips' doesn't exist' in /var/www/drupal/includes/datab
Stack trace:
#0 /var/www/drupal/includes/database/database.inc(1609): DatabaseConnection->query('SELECT 1 FROM {...', Array, Array)
#1 /var/www/drupal/includes/bootstrap.inc(1018): db_query('SELECT 1 FROM {...', Array)
#2 /var/www/drupal/includes/bootstrap.inc(1120): drupal_is_denied('10.10.10.253')
#3 /var/www/drupal/includes/bootstrap.inc(1065): _drupal_bootstrap(3)
#4 /var/www/drupal/index.php(21): drupal_bootstrap(9)
#5 {main}
  thrown in /var/www/drupal/includes/database/database.inc on line 509
[29-Dec-2008 13:59:04] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SELECT 1 FROM {blocked_ips} WHERE ip =
Array
(
    [:ip] => 10.10.10.253
)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.blocked_ips' doesn't exist' in /var/www/drupal/includes/datab
Stack trace:
#0 /var/www/drupal/includes/database/database.inc(1609): DatabaseConnection->query('SELECT 1 FROM {...', Array, Array)
#1 /var/www/drupal/includes/bootstrap.inc(1018): db_query('SELECT 1 FROM {...', Array)
#2 /var/www/drupal/includes/bootstrap.inc(1120): drupal_is_denied('10.10.10.253')
#3 /var/www/drupal/includes/bootstrap.inc(1065): _drupal_bootstrap(3)
#4 /var/www/drupal/index.php(21): drupal_bootstrap(9)
#5 {main}
[29-Dec-2008 13:59:04] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SELECT 1 FROM {blocked_ips} WHERE ip =
:ip -
Array
(
    [:ip] => 10.10.10.253
)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.blocked_ips' doesn't exist' in /var/www/drupal/includes/datab
ase/database.inc:509
Stack trace:
#0 /var/www/drupal/includes/database/database.inc(1609): DatabaseConnection->query('SELECT 1 FROM {...', Array, Array)
#1 /var/www/drupal/includes/bootstrap.inc(1018): db_query('SELECT 1 FROM {...', Array)
#2 /var/www/drupal/includes/bootstrap.inc(1120): drupal_is_denied('10.10.10.253')
#3 /var/www/drupal/includes/bootstrap.inc(1065): _drupal_bootstrap(3)
#4 /var/www/drupal/index.php(21): drupal_bootstrap(9)
#5 {main}
  thrown in /var/www/drupal/includes/database/database.inc on line 509
[29-Dec-2008 14:00:27] PHP Fatal error:  Call to undefined function filter_var() in /var/www/drupal/includes/common.inc on line
1168
0
0

-----------------------
2 ok a Drupalra:
1. A Drupal az egy Drupal (magyarul: Drupal). Valamikor tartalomkezelőnek indult....
2. Ha kilép az alapító folytathatjuk magyarul. :)

Pál úr képe

Az előbb relatív volt, most nézzük ugyanezt abszolúttal (gondolom, arra gondoltál) -- kizárólag az iszonyat hosszú stílust szedtem ki belőle.

Received: from apache by yyy.xx.hu with local (Exim 4.69)
	(envelope-from <apache@yyy.xx.hu>)
	id 1LYm27-0005Zj-UZ
	for user@florka.hu; Sun, 15 Feb 2009 19:48:04 +0100
To: user@florka.hu
Subject: =?UTF-8?B?W1RldMWRYWthZMOpbWlhIGjDrXJsZXbDqWxdIFByw7NiYSA3?=
Errors-To: user@florka.hu
From: "=?UTF-8?B?VGV0xZFha2Fkw6ltaWE=?="
    <hirlevel@zzz.hu>
Content-Type: multipart/alternative;
    charset=utf-8;
    boundary="66cde5954313d3d8d086cfacf74ce81a"
MIME-Version: 1.0
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal
Sender: user@florka.hu
Reply-To: "=?UTF-8?B?VGV0xZFha2Fkw6ltaWE=?="
    <hirlevel@zzz.hu>
Priority: urgent
X-Priority: 2
X-MSMail-Priority: High
Precedence: bulk
List-Unsubscribe: <http://www.zzz.hu/newsletter/confirm/remove/75b8b6624e1t2>
Message-Id: <E1LYm27-0005Zj-UZ@yyy.xx.hu>
Date: Sun, 15 Feb 2009 19:48:03 +0100
 
This is a multi-part message in MIME format.
 
--66cde5954313d3d8d086cfacf74ce81a
Content-Type: multipart/alternative;
    boundary="aa5cd0b8d0ea3b18194f3c3d999fe199"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
 
 
--aa5cd0b8d0ea3b18194f3c3d999fe199
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
 
-------- PRÓBA 7 ------------------------------------------------------------
 
 
Unsubscribe from this newsletter  
http://www.zzz.hu/newsletter/confirm/remove/75b8b6624e1t2
 
- - - This is a test version of the newsletter. - - -
 
--aa5cd0b8d0ea3b18194f3c3d999fe199
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">

[...]
</style></head><body id="mimemail-body"><div id="center"><div id="main"><h2>Próba 7</h2> <p><img src="http://www.zzz.hu/system/files/logo2009.jpg" border="0" width="175" height="140" /></p> <p class="newsletter-footer"><a href="http://www.zzz.hu/newsletter/confirm/remove/75b8b6624e1t2">Unsubscribe from this newsletter</a></p> - - - This is a test version of the newsletter. - - - </div></div></body></html>
--aa5cd0b8d0ea3b18194f3c3d999fe199--
 
--66cde5954313d3d8d086cfacf74ce81a--
0
0

ddblock+views_slideshow_ddblock

hu0882 képe

Van egy Apróhirdetés tartalomtípusom. Jelenleg úgy működik, hogy a beküldésnél be lehet pipálni, hogy normál vagy kiemelt hirdetésként jelenjen meg. Views-al megoldottam, hogy kiemelt hirdetés esetén a főoldalon egy blokkban jelenik meg az apróhirdetés címe és egy image fielddel feltöltött kép. Szeretném megoldani, hogy a kiemelt hirdetéseket a főoldali blokkban lehessen léptetni . Nagyon megtetszettek a ddblock modulban rejlő lehetőségek, de sajnos nem sikerült beüzemelnem. Odáig eljutottam, hogy felinstalláltam a ddblock, views_slideshow és views_slideshow_ddblock modulokat.

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