Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / Renew ad doesn't check group of the users

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

Renew ad doesn't check group of the users

More
8 years 2 months ago #24127 by evgeniex
Hello!
There is a problem with updating the ads, In the case, when there are many user groups are assigned using paidsystem available time of publication. If you choose to renew in myads accessible to the user all installed duration of publication for this category. In fact, on the page expiration sampling is used only for categories, not for groups of users.

In case of publish new ad - it works perfect
More
8 years 1 month ago #24140 by loic
Hello,

Just to clarify, if you renew an expirated ads all the durations are displayed and ignore the filters ?

Best regards.
More
8 years 1 month ago #24144 by evgeniex
Replied by evgeniex on topic Renew ad doesn't check group of the users
Yes in /components/com_paidsystem/views/edit/tmpl
used
 if(checkRightOption($duration) == true) {
                if ((strpos($duration->catsid, ",$currentcat,") !== false)||(strpos($duration->catsid, ",-1,") !== false))

it works

but in components/com_paidsystem/views/expiration/tmpl
this doesn't used. when I try do somthing, like in first case
?php 
	$currentcat = JRequest::getInt("catid",-1);
 
 
                            foreach($durations as $duration) {
 
 
		if(checkRightOption($duration) == true) {
                if ((strpos($duration->catsid, ",$currentcat,") !== false)||(strpos($duration->catsid, ",-1,") !== false))
                {
                    $selected = "";
                    if(isset($row->duration)) {
                        if($row->duration == $duration->id)
                            $selected = "selected='selected'";
                    }
 
                    if ($duration->duration == 0) {
                        if ($duration->credits > 0)
                            echo "<option $selected value='$duration->id'>".sprintf(JText::_('PAIDSYSTEM_NO_EXPIRATION_WITH_PRICE'), getPrice($duration->credits))."</option>";
                        else
                            echo "<option $selected value='$duration->id'>".JText::_('PAIDSYSTEM_NO_EXPIRATION')."</option>";
                    } else {
                        if ($duration->credits > 0)
			echo "<option value='$duration->id'>".sprintf(JText::_('PAIDSYSTEM_DURATION_DISPLAY'),$duration->duration, getPrice ($duration->credits))." (".date("d-m-Y",$duration->duration*3600*24 + strtotime($date)).")</option>";
		else
			echo "<option value='$duration->id'>".sprintf(JText::_('PAIDSYSTEM_DURATION_SHORT_DISPLAY'),$duration->duration)." (".date("d-m-Y",$duration->duration*3600*24 +strtotime($date)).")</option>";
                    }
                }
            }						
 
 
 
	}
                        ?>
 
 
 

I get all the possible options for the duration of the ads which should NOT be shown for this user group. and those that should - not appear

If the code does not change, it displays all the existing options of duration
More
8 years 1 month ago - 8 years 1 month ago #24152 by evgeniex
Replied by evgeniex on topic Renew ad doesn't check group of the users
I have Some problems with PHP, but found a solution that works.
in components/com_paidsystem/views/expiration/tmpl/default.php
 
<?php 
/**
 *  @package	PaidSystem
 *  @copyright	Copyright (C) 2010-2014 Juloa.com. All rights reserved.
 *  @license    GNU General Public License version 3, or later
 */
defined('_JEXEC') or die( 'Restricted access' );
 
?>
    <div class="row-fluid">
        <div class="span12">
            <div class="control-group">
                <label class="control-label" for="ad_duration"><?php echo JText::_('PAIDSYSTEM_DURATION'); ?></label>
                <div class="controls">
                    <select name='ad_duration' id='ad_duration' mosReq='1' onchange="changeDuration(this)" mosLabel='<?php echo htmlspecialchars(JText::_('PAIDSYSTEM_DURATION'),ENT_QUOTES); ?>' class='adsmanager_required'>
                        <option value=''><?php echo JText::_('PAIDSYSTEM_DURATION_SELECT'); ?></option>
 
						<?php 
 
if (count($durations) != 0) {
$currentcat = JRequest::getInt("catid",-1);
	 $user = JFactory::getUser();
	$user=$user->groups;
foreach($durations as $duration) {
$group=$duration->params;
$group = preg_replace('/[^0-9]/i', ' ', $group); 
$array = explode(' ', $group);
foreach($user as $u) {
        if(in_array($u, $array)   === false){
		}
else {
            $showOption = true;
		if ($duration->credits > 0)
			echo "<option value='$duration->id'>".sprintf(JText::_('PAIDSYSTEM_DURATION_DISPLAY'),$duration->duration, getPrice ($duration->credits))." (".date("d-m-Y",$duration->duration*3600*24 + strtotime($date)).")</option>";
		else
			echo "<option value='$duration->id'>".sprintf(JText::_('PAIDSYSTEM_DURATION_SHORT_DISPLAY'),$duration->duration)." (".date("d-m-Y",$duration->duration*3600*24 +strtotime($date)).")</option>";
		}
}	
}	
 
                        ?>
                    </select>
 
// The rest of the code unchanged
Last edit: 8 years 1 month ago by evgeniex.
More
8 years 1 month ago #24165 by loic
Hello,

If your solution work then, feel free to use it, however, it is still a problem in the component so I will fix that for the next version :)

Best regards.
Moderators: perry
Time to create page: 0.201 seconds
Powered by Kunena Forum