ho provato a fare il modulo pay per node
per il rotor
Ma devo aver sbagliato qualdche cosa (anche perchè l'ho modificato dal payper node ad...
Magari insieme possiamo capire dove ho sbagliato
<?php
// overriding men√π items for node types created by rotor module
function paypernode_rotor_menu_alter(&$items) {
// ahah callbacks
$items['node/add/rotor/ahah']['access callback'] = 'paypernode_node_add_page_access';
// rotor types and access handling
$items['node/add/rotor/%/%']=array(
'page callback' => 'paypernode_node_add_new',
'page arguments' => array(2, 3, 4),
'access callback' => 'paypernode_node_add_new_rotor_access',
'access arguments' => array(3, 4),
'file' => 'node.pages.inc',
'file path' => drupal_get_path('module', 'node'),
);
}
// check if user can create this type
function paypernode_node_add_new_rotor_access($type, $tid) {
return paypernode_node_add_new_access('rotor:' . $type . ':' . (int)$tid);
}
function paypernode_rotor_paypernode_init($node, $args) {
// validate values against present rotor types
$node['rotortype']=$args[0];
$node['taxonomy'][_rotor_get_vid()] = (int)$args[1];
$node['rotorstatus']='active';
$node['maxviews']=40;
return $node;
}
function paypernode_rotor_paypernode_form_alter($form, $form_state) {
//debug($form_state);
/*
$form['taxonomy'][_rotor_get_vid()]=array(
'#type' => 'hidden',
'#value' => $form['#node']->taxonomy[_rotor_get_vid()],
);
*/
$args=explode(':', $form['#paypernode_type']);
array_shift($args);
$form['taxonomy'][_rotor_get_vid()]['#disabled']=TRUE;
$form['taxonomy'][_rotor_get_vid()]['#default_value']=$args[1];//$form['#node']->taxonomy[_rotor_get_vid()];
/*
array(
'#type' => 'hidden',
'#value' => $form['#node']->taxonomy[_rotor_get_vid()],
);
*/
// from varaiables
$form['schedule']['maxviews']=array(
'#type' => 'hidden',
'#value' => $form['#node']->maxviews,
);
return $form;
}
function paypernode_rotor_paypernode_info($all=FALSE) {
$types=array();
$rotor_types=rotor_get_types();
$rotor_groups=rotor_groups_list();
if (count($rotor_types)) {
foreach ($rotor_types as $rotor_type => $rotor_name) {
if (count($rotor_groups)) {
foreach ($rotor_groups as $group_vid => $group_name) {
if ($all|variable_get('paypernode_type_rotor:' . $rotor_type . ':' . $group_vid, FALSE)) {
$index='rotor:' . $rotor_type . ':' . $group_vid;
$types[$index]=new stdClass;
$types[$index]->name=drupal_ucfirst($rotor_name . ' (' . $group_name . ')');
$types[$index]->description='rotor description';
$types[$index]->module='paypernode_rotor';
}
}
}
if ($all|variable_get('paypernode_type_rotor:' . $rotor_type . ':0', FALSE)) {
$index='rotor:' . $rotor_type . ':0';
$types[$index]=new stdClass;
$types[$index]->name=drupal_ucfirst($rotor_name . ' (' . t('Uncategorized') . ')');
$types[$index]->description='rotor description';
$types[$index]->module='paypernode_rotor';
}
}
}
return $types;
}
a proposito... ho fatto il modulo paypal donation in versione euro...
dove lo posso mettere in upload per gli altri?
spero che qualcuno mi dia una mano... insieme possiamo creare un aggiornamento che non esiste nemmeno nel sito ufficiale di drupal!
www.dragossido.com drupal 7.x
www.io-ho.com drupal 7.x
www.io-imparo.com drupal 7.x
www.spettacolando.com drupal 7.x
www.napolisgulf.com php
yes we can!
www.dragossido.com drupal 7.x
www.io-ho.com drupal 7.x
www.io-imparo.com drupal 7.x
www.spettacolando.com drupal 7.x
www.napolisgulf.com php
Mi interessa il discorso paypal donation / euro. Puoi spiegare meglio?
Anzi, perché non apri una discussione apposita, così uno che lo cerca la trova con il titolo giusto?
a me invece interessava sviluppare meglio il pay per node per tutti i tipi di contenuto...
per quanto ruiguarda il paypal donation in euro... se mi dici dove devo caricare i file, per fare in modo che anche altri possono scaricarlo, non c'è problema!
www.dragossido.com drupal 7.x
www.io-ho.com drupal 7.x
www.io-imparo.com drupal 7.x
www.spettacolando.com drupal 7.x
www.napolisgulf.com php
Io per condividere cose qui ho aperto un account github.com
Se sai usare git in locale, mi sembra una buona idea.
Altrimenti, metto uno zip in una cartella di un tuo server.
si, ma dai... è una piccolezza che ho cambiato....
invece sarebbe bello ampliare il paypernode
www.dragossido.com drupal 7.x
www.io-ho.com drupal 7.x
www.io-imparo.com drupal 7.x
www.spettacolando.com drupal 7.x
www.napolisgulf.com php