Skip to content

Commit

Permalink
Same fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Feb 7, 2023
1 parent af85cef commit c201920
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea/
/dist/
114 changes: 71 additions & 43 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,122 +1,150 @@
<project name="junewsultra" default="dist" basedir=".">
<project name="junewsultra"
default="dist"
basedir=".">

<property name="VERSION" value="7.3"/>
<property name="VERSION"
value="7.4" />

<tstamp>
<format property="DATE" pattern="%d.%m.%Y" />
<format property="DATE"
pattern="%d.%m.%Y" />
</tstamp>

<property name="juimage" value="5.11"/>
<property name="juimage"
value="5.12" />

<property name="build" value="build"/>
<property name="temp" value="temp"/>
<property name="dist" value="dist"/>
<property name="build"
value="build" />
<property name="temp"
value="temp" />
<property name="dist"
value="dist" />

<property name="filename" value="pkg_junewsultra_pro_v${VERSION}.zip"/>
<property name="filename"
value="pkg_junewsultra_pro_v${VERSION}.zip" />

<target name="init" depends="clean">
<mkdir dir="${build}"/>
<mkdir dir="${temp}"/>
<mkdir dir="${dist}"/>
<target name="init"
depends="clean">
<mkdir dir="${build}" />
<mkdir dir="${temp}" />
<mkdir dir="${dist}" />
</target>

<target name="temp">

<copy todir="${temp}/language">
<fileset dir="language">
<include name="**"/>
<include name="**" />
</fileset>
</copy>

<copy todir="${temp}">
<fileset dir="packages">
<include name="**"/>
<include name="**" />
</fileset>
</copy>

</target>

<target name="replace">

<copy file="pkg_junewsultra.xml" todir="${build}">
<copy file="pkg_junewsultra.xml"
todir="${build}">
<filterchain>
<replacetokens>
<token key="version" value="${VERSION}" />
<token key="date" value="${DATE}" />
<token key="juimage" value="${juimage}" />
<token key="version"
value="${VERSION}" />
<token key="date"
value="${DATE}" />
<token key="juimage"
value="${juimage}" />
</replacetokens>
</filterchain>
</copy>

<copy file="packages/mod_junewsultra/mod_junewsultra.xml" todir="${temp}/temp/mod_junewsultra">
<copy file="packages/mod_junewsultra/mod_junewsultra.xml"
todir="${temp}/temp/mod_junewsultra">
<filterchain>
<replacetokens>
<token key="version" value="${VERSION}" />
<token key="date" value="${DATE}" />
<token key="version"
value="${VERSION}" />
<token key="date"
value="${DATE}" />
</replacetokens>
</filterchain>
</copy>

<delete file="${temp}/mod_junewsultra/mod_junewsultra.xml"/>
<copy file="${temp}/temp/mod_junewsultra/mod_junewsultra.xml" todir="${temp}/mod_junewsultra"/>
<delete file="${temp}/mod_junewsultra/mod_junewsultra.xml" />
<copy file="${temp}/temp/mod_junewsultra/mod_junewsultra.xml"
todir="${temp}/mod_junewsultra" />


<copy file="packages/tmpl_mod_junewsultra_default/default.xml" todir="${temp}/temp/tmpl_mod_junewsultra_default">
<copy file="packages/tmpl_mod_junewsultra_default/default.xml"
todir="${temp}/temp/tmpl_mod_junewsultra_default">
<filterchain>
<replacetokens>
<token key="version" value="${VERSION}" />
<token key="date" value="${DATE}" />
<token key="version"
value="${VERSION}" />
<token key="date"
value="${DATE}" />
</replacetokens>
</filterchain>
</copy>

<delete file="${temp}/tmpl_mod_junewsultra_default/default.xml"/>
<copy file="${temp}/temp/tmpl_mod_junewsultra_default/default.xml" todir="${temp}/tmpl_mod_junewsultra_default"/>
<delete file="${temp}/tmpl_mod_junewsultra_default/default.xml" />
<copy file="${temp}/temp/tmpl_mod_junewsultra_default/default.xml"
todir="${temp}/tmpl_mod_junewsultra_default" />

</target>

<target name="pack-plugins">

<mkdir dir="${build}/packages"/>
<mkdir dir="${build}/packages" />

<zip destfile="${build}/packages/mod_junewsultra.zip" description="mod_junewsultra">
<fileset dir="${temp}/mod_junewsultra"/>
<zip destfile="${build}/packages/mod_junewsultra.zip"
description="mod_junewsultra">
<fileset dir="${temp}/mod_junewsultra" />
</zip>

<zip destfile="${build}/packages/tmpl_mod_junewsultra_default.zip" description="tmpl_mod_junewsultra_default">
<fileset dir="${temp}/tmpl_mod_junewsultra_default"/>
<zip destfile="${build}/packages/tmpl_mod_junewsultra_default.zip"
description="tmpl_mod_junewsultra_default">
<fileset dir="${temp}/tmpl_mod_junewsultra_default" />
</zip>

<copy file="../JUImage/dist/pkg_juimage_v${juimage}.zip" todir="${build}/packages"/>
<copy file="../JUImage/dist/pkg_juimage_v${juimage}.zip"
todir="${build}/packages" />

<copy todir="${build}/language">
<fileset dir="${temp}/language">
<include name="**"/>
<include name="**" />
</fileset>
</copy>

<copy file="pkg_junewsultra.xml" todir="${build}"/>
<copy file="pkg_junewsultra.xml"
todir="${build}" />

<copy file="script.php" todir="${build}"/>
<copy file="script.php"
todir="${build}" />

</target>

<target name="dist" depends="init, temp, replace, pack-plugins">
<target name="dist"
depends="init, temp, replace, pack-plugins">
<zip destfile="${dist}/${filename}">
<fileset dir="${build}/">
<include name="**/**"/>
<include name="**/**" />
</fileset>
</zip>

<delete dir="${build}"/>
<delete dir="${temp}"/>
<delete dir="${build}" />
<delete dir="${temp}" />

</target>

<target name="clean">

<delete dir="${build}"/>
<delete dir="${temp}"/>
<delete dir="${build}" />
<delete dir="${temp}" />

</target>

Expand Down
2 changes: 1 addition & 1 deletion packages/mod_junewsultra/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public function xml($feed_url, $xmlcount, $cache_file, $time, $path, $ordering_x
switch($ordering_xml)
{
case 'rand':
$items = $xml->xpath(sprintf($path . '[position()]'));
$items = $xml->xpath(sprintf($path . '[position()]', $xmlcount));
shuffle($items);
$items = array_slice($items, 0, $xmlcount);
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/mod_junewsultra/fields/multicategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function getOptions()
$tables = $db->getTableList();
$dbprefix = $db->getPrefix();

if(in_array($dbprefix . $dbtable, $tables))
if(in_array($dbprefix . $dbtable, $tables, true))
{
$db->setQuery($sql);
$results = $db->loadObjectList();
Expand Down
2 changes: 1 addition & 1 deletion packages/mod_junewsultra/fields/uploadimg.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function alert($text, $error)
$filename = $_FILES[ 'userfile' ][ 'tmp_name' ];
$ext = pathinfo($_FILES[ 'userfile' ][ 'name' ])[ 'extension' ];

if(!in_array($ext, $valid_types))
if(!in_array($ext, $valid_types, true))
{
$alert = alert(JText::_('MOD_JUNEWS_ERROR2'), 'notice');
}
Expand Down

0 comments on commit c201920

Please sign in to comment.