$items[] = array(<br>
'path' => 'admin/settings/featured-<div id=":mh" class="ArwC7c ckChnd">comments/feature',<br>
'title' => t('featured comment'),<br>
'callback' => 'feature_comment',<br>
'callback_args' => $_GET['cid'],<br><br>should be..<br><br>$items[] = array(<br>
'path' => 'admin/settings/featured-comments/feature/%',<br><div id=":mh" class="ArwC7c ckChnd">
'title' => t('featured comment'),<br>
'callback' => 'feature_comment',<br>
'callback_args' =>array(4),</div>...<br><br>try this..<br></div><br><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 12:46 PM, Steven Jones <span dir="ltr"><<a href="mailto:darthsteven@gmail.com">darthsteven@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I'm not how to relates to development of Drupal, so I'll try to kill<br>
this thread, here's the main issue:<br>
<br>
Your hook_menu returns an item with a 'callback_args', key, that key<br>
should be: 'callback arguments' and the value should be an array of<br>
arguments to pass to the callback.<br>
<br>
<a href="http://api.drupal.org/api/function/hook_menu/5" target="_blank">http://api.drupal.org/api/function/hook_menu/5</a><br>
<br>
Regards<br>
Steven Jones<br>
ComputerMinds ltd - Perfect Drupal Websites<br>
<br>
Phone : 0121 288 0434<br>
Mobile : 07951 270 026<br>
<a href="http://www.computerminds.co.uk" target="_blank">http://www.computerminds.co.uk</a><br>
<br>
<br>
<br>
2009/2/3 cooper Quintin <<a href="mailto:cooperq@cooperq.com">cooperq@cooperq.com</a>>:<br>
<div><div></div><div class="Wj3C7c">> Hello all,<br>
> I am writing a module and I am trying to use a url as a callback<br>
> argument, but it does not work. Here is the code:<br>
><br>
> $items[] = array(<br>
> 'path' => 'admin/settings/featured-comments/feature',<br>
> 'title' => t('featured comment'),<br>
> 'callback' => 'feature_comment',<br>
> 'callback_args' => $_GET['cid'],<br>
> 'access' => user_access('administer comments'),<br>
> 'type' => MENU_CALLBACK<br>
> );<br>
><br>
> and the callback function:<br>
> function feature_comment($cid) {<br>
> $comment = _comment_load($cid);<br>
> db_query("UPDATE {featured_comments} SET featured=1 WHERE cid=%d", $cid);<br>
> drupal_goto("node/$comment->nid");<br>
> }<br>
><br>
> going to an example url:<br>
> <a href="http://example.com/admin/settings/featured-comments/feature?cid=10840" target="_blank">http://example.com/admin/settings/featured-comments/feature?cid=10840</a><br>
> gives the following error: warning: Missing argument 1 for<br>
> feature_comment() in<br>
> /var/www/html/sites/all/modules/featured_comments/featured_comments.module<br>
> on line 149.<br>
><br>
><br>
> So my question is, what is the best way to use parts of the linked url<br>
> as a callback argument for a function, because obviously it is not what<br>
> I am doing!<br>
> Thanks,<br>
><br>
> --<br>
> Cooper Quintin<br>
> Freelance Programmer, Indymedia Journalist<br>
> <a href="http://CooperQ.com" target="_blank">http://CooperQ.com</a><br>
> (510) 827-5382<br>
><br>
><br>
</div></div></blockquote></div><br>