<div dir="ltr">$files = \OCA\CloudToCloud\CloudToCloudShare::getFiles($email,$dir); // this is called from the 'public' page<br><div><br></div><div><br></div><div><div><br></div><div> public static function getFiles($email,$dir){</div>
<div> $query = \OC_DB::prepare("SELECT * FROM *PREFIX*c2c_share WHERE `email`=? ORDER BY `stime`");</div><div> $result = $query->execute(array($email));</div><div> $files = array();</div>
<div><br></div><div> if($dir == ""){</div><div> while ($aFile = $result->fetchRow()) {</div><div> if($aFile['item_type'] == "file"){</div><div> $name = $aFile['file_target'];</div>
<div> $path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div><div> $parent_path = substr($path,0,strrpos($path,'/')+1);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($parent_path);</div>
<div><br></div><div> foreach($dir_content as $i){</div><div> if($i['name'] == $name && $i['type']=="file"){</div><div> $files[] = $i;</div>
<div> break;</div><div> }</div><div> }</div><div> }else{</div><div> $name = $aFile['file_target'];</div><div> $path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div>
<div> $parent_path = substr($path,0,strrpos($path,'/')+1);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($parent_path);</div><div> foreach($dir_content as $i){</div>
<div> if($i['name'] == $name && $i['type']=="dir"){</div><div> $files[] = $i;</div><div> break;</div><div> }</div>
<div> }</div><div> }</div><div> }</div><div> }else{</div><div> while($aFile = $result->fetchRow()){</div><div> if($aFile['item_type'] == "dir" && $aFile['file_target'] == $dir){</div>
<div> $path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($path);</div><div> foreach($dir_content as $i){</div>
<div> $files[] = $i;</div><div> }</div><div> }</div><div> }</div><div><br></div><div> }</div><div> return $files;</div><div> }</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 26, 2013 at 3:26 AM, Bernhard Posselt <span dir="ltr"><<a href="mailto:nukeawhale@gmail.com" target="_blank">nukeawhale@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">File functions? Can you elaborate or show some code?<br>
<div class="HOEnZb"><div class="h5"><br>
On 06/25/2013 09:28 PM, Tharindu Dhananjaya Galappaththi wrote:<br>
> Without logging in to owncloud, I want to display some file info on the<br>
> public page. Is it possible to call file functions without logging in to<br>
> owncloud? It is giving me errors.<br>
> Please help<br>
><br>
><br>
> On Sun, Jun 23, 2013 at 4:37 PM, Bernhard Posselt <<a href="mailto:nukeawhale@gmail.com">nukeawhale@gmail.com</a>>wrote:<br>
><br>
>> Its very easy: use a guest template (<br>
>><br>
>> <a href="http://doc.owncloud.org/server/5.0/developer_manual/app/app/api/templates.html#OC_Template::printGuestPage" target="_blank">http://doc.owncloud.org/server/5.0/developer_manual/app/app/api/templates.html#OC_Template::printGuestPage</a><br>
>> )<br>
>> and dont check if the user is logged in<br>
>><br>
>> On 06/23/2013 10:29 AM, Tharindu Dhananjaya Galappaththi wrote:<br>
>>> Hi,<br>
>>> I'm trying to create a page in a app, that can be accessed with out<br>
>> logging<br>
>>> in to owncloud.<br>
>>> I followed the procedure mentioned in :<br>
>>> <a href="http://owncloud.org/apps/public-php-and-remote-php/" target="_blank">http://owncloud.org/apps/public-php-and-remote-php/</a> , but it is not<br>
>>> working.<br>
>>> Please help me with this.<br>
>>> Thank You<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Owncloud mailing list<br>
>>> <a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
>>> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
>> _______________________________________________<br>
>> Owncloud mailing list<br>
>> <a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
>> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Owncloud mailing list<br>
> <a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
<br>
_______________________________________________<br>
Owncloud mailing list<br>
<a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
</div></div></blockquote></div><br></div>