You'll want to use<br><br><a href="http://example.com/admin/settings/featured-comments/feature?cid=10840" target="_blank">http://example.com/admin/settings/featured-comments/feature/10840</a><br><br>as url.<br><br>But also:<br>
<br>function feature_comment($cid = NULL) {<br> if (!isset($cid)) {<br> // Do something else.<br> drupal_goto(...);<br> }<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><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 11:34 AM, cooper Quintin <span dir="ltr"><<a href="mailto:cooperq@cooperq.com">cooperq@cooperq.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;">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>
<font color="#888888"><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>
</font></blockquote></div><br>