The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I have the following conditional for a hack:
Code:
<if condition="$attachment['replay']['official']">
<img src='images/mappics/{$attachment[replay][picname]}.png' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][picpname]}' />
<else />
<img src='images/mappics/unofficial.jpg' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][mapname]}' />
</if>
If the map is an official one the picture of the map is displayed, if not a placeholder picture. Now we want to display, one after the other, also pictures of unofficial maps - of course only if the file for the map exists. Question: Is it possible to create something in a template that is looking into a specified folder in order to check wether a file is present or not? |
|
#2
|
|||
|
|||
|
That would be easier to do with a small bit of PHP in a plugin.
|
|
#3
|
||||
|
||||
|
In the plug-in use:
Code:
$show['something'] = file_exists('./yourfolder/yourfile.php');
HTML Code:
<if condition="$show['something']"> do this </if> |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|