<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
hmm, can't see how that would apply in my case. Maybe it does, but
can't see it.<br>
<br>
bottom line: if an sql query returns 3 values, how do I get those 3
values into a Views argument via "provide default argument"?<br>
<br>
On 20/11/2010 10:30, Idan Arbel wrote:
<blockquote
cite="mid:03c301cb88b7$2b0a2930$811e7b90$@arbel-designs.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 11pt; font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">Take a look at this code I used for something
similar:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span class="apple-style-span"><span
style="font-size: 9pt; font-family: "Lucida
Console"; color: rgb(34, 34, 34);">if (arg(0) ==
'node' && is_numeric(arg(1))) {</span></span><span
style="font-size: 9pt; font-family: "Lucida
Console"; color: rgb(34, 34, 34);"><br>
<span class="apple-style-span">$node=node_load(arg(1));</span><br>
<span class="apple-style-span">$term =
taxonomy_node_get_terms_by_vocabulary($node, 4); // 4
being the vocabulary id</span><br>
<span class="apple-style-span">$terms = array_keys($term);</span><br>
<span class="apple-style-span">$args[0] = $terms[0];</span><br>
<span class="apple-style-span">for($i=1;
$i<count($terms); $i++)</span><br>
<span class="apple-style-span">$args[0] = $args[0] ."+"
.$terms[$i]; // replace the + with , if you want and "And"
action instead of "or"</span><br>
<span class="apple-style-span">}</span><br>
<span class="apple-style-span">return $args[0];<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-style-span"><span
style="font-size: 9pt; font-family: "Lucida
Console"; color: rgb(34, 34, 34);"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span class="apple-style-span"><span
style="font-size: 9pt; font-family: "Lucida
Console"; color: rgb(34, 34, 34);">might help you
out.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-style-span"><span
style="font-size: 9pt; font-family: "Lucida
Console"; color: rgb(34, 34, 34);"><br>
Idan</span></span><span style="font-size: 11pt;
font-family: "Calibri","sans-serif";
color: rgb(31, 73, 125);"><o:p></o:p></span></p>
<p class="MsoNormal"><a moz-do-not-send="true"
name="_MailEndCompose"><span style="font-size: 11pt;
font-family: "Calibri","sans-serif";
color: rgb(31, 73, 125);"><o:p> </o:p></span></a></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; border-color:
rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif"; color:
windowtext;">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif"; color:
windowtext;"> <a class="moz-txt-link-abbreviated" href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a>
[<a class="moz-txt-link-freetext" href="mailto:support-bounces@drupal.org">mailto:support-bounces@drupal.org</a>] <b>On Behalf Of </b>Neil
Coghlan<br>
<b>Sent:</b> Saturday, November 20, 2010 3:25 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:support@drupal.org">support@drupal.org</a><br>
<b>Subject:</b> Re: [support] Passing multiple values
into a single Views argument<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Idan, I only just realised myself there was
an "accept multiple arguments" checkbox....without that, I
never would get it working!<br>
<br>
so...now with that checked, I still need to get the UID's
passed in x,y,z or x+y+z format.<br>
<br>
On 20/11/2010 10:21, Idan Arbel wrote: <o:p></o:p></p>
<div>
<p class="MsoNormal">if you want to view to take them into
account as using "AND" then return them like so: 12+32+34,
if you want it to take them into account as or return them
as so 12,32,34. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;">don't
forget to check to box in the argument settings area to
accept multiple arguments<o:p></o:p></p>
<div>
<p class="MsoNormal">On Sat, Nov 20, 2010 at 3:14 PM, Neil
Coghlan <<a moz-do-not-send="true"
href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</a>>
wrote:<o:p></o:p></p>
<p class="MsoNormal">I have a view where I have selected
User:uid as an argument and I am<br>
using a sql query in the "Provide Default Argument"
part. The problem<br>
is, usually, the sql query is passing muliple UIDs back.
How would I<br>
pass all of them into the argument to be used by the
view.<br>
<br>
At the moment, the view is only taking the first one.<br>
<br>
so, here is a simplified version of my php code:<br>
<br>
global $user;<br>
$result = db_query("SELECT node.uid FROM {node}<br>
WHERE node.type = 'profile'");<br>
$member = db_fetch_object($result);<br>
return "$member->uid";<br>
<br>
on my current db, this returns 3 UIDs...the view only
takes the first one.<br>
<br>
Thanks<br>
<br>
Neil<br>
<span style="color: rgb(136, 136, 136);"><br>
<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</blockquote>
</body>
</html>