<!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="#333333">
<font size="-1"><font face="Helvetica, Arial, sans-serif">For some
reason this works from deeper directory levels: opendir("files/"); <br>
but this doesn't: </font></font><font size="-1"><font
face="Helvetica, Arial, sans-serif">opendir(base_path() ."files/"); <br>
<br>
Is this a misapplication?<br>
</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
</font></font><br>
Victor Kane wrote:
<blockquote
cite="mid:ff176450808021007l54b297b8y5af6adbe69246ab@mail.gmail.com"
type="cite">
<div dir="ltr">Well, assuming you are talking about URLs, you should
be all set. All Drupal modules see the world from the Drupal document
root, so <?php base_path() .
'files' ?> should be fine for a URL.<br>
<br>
What is it you cannot get done?<br>
<br>
<div class="gmail_quote">On Sat, Aug 2, 2008 at 1:01 PM, John Horning
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:john@rivul.com">john@rivul.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;">
<div bgcolor="#ffffff" text="#333333">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Do you
know
anything about file_directory_path()? It returns "files", which is
correct for use from the home directory, but not useful on other levels.<br>
<br>
</font></font>
<div>
<div class="Wj3C7c"><br>
John Horning wrote:
<blockquote type="cite"> <font size="-1"><font
face="Helvetica, Arial, sans-serif">I can't get
anything other than "/" returned by base_path(), regardless of the
level I'm on. I must be missing something.<br>
<br>
</font></font><br>
Victor Kane wrote:
<blockquote type="cite">
<div dir="ltr">As URL?<br>
<br>
Assuming it were ./files, then try sthg like <?php base_path() .
'files' ?><br>
<br>
<div class="gmail_quote">On Sat, Aug 2, 2008 at 9:15 AM, John
Horning <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:john@rivul.com" target="_blank">john@rivul.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;">
<div bgcolor="#ffffff" text="#333333"> <font size="-1"><font
face="Helvetica, Arial, sans-serif">Thanks.
Is
there something like that to get me to the files directory?<br>
John<br>
</font></font><br>
Victor Kane wrote:
<blockquote type="cite">
<div>
<div>
<div dir="ltr"><code><span style="color: rgb(0, 0, 0);"><span
style="color: rgb(0, 0, 187);">Try the following:<br>
<br>
<?php base_path</span><span style="color: rgb(0, 119, 0);">() . </span><span
style="color: rgb(0, 0, 187);">path_to_theme</span><span
style="color: rgb(0, 119, 0);">() </span><span
style="color: rgb(0, 0, 187);">?></span></span>/box_bottom.png<br>
<br>
</code><code><img src="<span style="color: rgb(0, 0, 0);"><span
style="color: rgb(0, 0, 187);"><?php </span><span
style="color: rgb(0, 119, 0);">print </span><span
style="color: rgb(0, 0, 187);">base_path</span><span
style="color: rgb(0, 119, 0);">() . </span><span
style="color: rgb(0, 0, 187);">path_to_theme</span><span
style="color: rgb(0, 119, 0);">() . </span><span
style="color: rgb(221, 0, 0);">"/pic/mary.png"</span><span
style="color: rgb(0, 119, 0);">; </span><span
style="color: rgb(0, 0, 187);">?></span></span>" /></code><br>
<br>
Victor Kane<br>
<a moz-do-not-send="true" href="http://awebfactory.com.ar"
target="_blank">http://awebfactory.com.ar</a><br>
<br>
<div class="gmail_quote">On Fri, Aug 1, 2008 at 10:28 PM,
John
Horning <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:john@rivul.com" target="_blank">john@rivul.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;">
<div bgcolor="#ffffff" text="#333333">Apparently Drupal
does
not allow you to reference absolute URL paths in
scripts, which is causing me a problem. I have a script in my
page.tpl.php that randomly picks images from a directory and displays
them in the header. This works when you're on the top level, but not
below since I'm using a relative path to get to the image directory.
Can anyone tell me the proper way of doing this?<br>
</div>
<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
<pre>No virus found in this incoming message.
Checked by AVG - <a moz-do-not-send="true" href="http://www.avg.com"
target="_blank">http://www.avg.com</a>
Version: 8.0.138 / Virus Database: 270.5.10/1585 - Release Date: 8/1/2008 6:39 AM
</pre>
</blockquote>
</div>
<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
</blockquote>
</div>
<br>
</div>
<pre>No virus found in this incoming message.
Checked by AVG - <a moz-do-not-send="true" href="http://www.avg.com"
target="_blank">http://www.avg.com</a>
Version: 8.0.138 / Virus Database: 270.5.10/1586 - Release Date: 8/1/2008 6:59 PM
</pre>
</blockquote>
<pre>No virus found in this incoming message.
Checked by AVG - <a moz-do-not-send="true" href="http://www.avg.com"
target="_blank">http://www.avg.com</a>
Version: 8.0.138 / Virus Database: 270.5.10/1586 - Release Date: 8/1/2008 6:59 PM
</pre>
</blockquote>
</div>
</div>
</div>
<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
</blockquote>
</div>
<br>
</div>
<pre>No virus found in this incoming message.
Checked by AVG - <a class="moz-txt-link-freetext" href="http://www.avg.com">http://www.avg.com</a>
Version: 8.0.138 / Virus Database: 270.5.10/1586 - Release Date: 8/1/2008 6:59 PM
</pre>
</blockquote>
</body>
</html>