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 / Support / AdsManager Support / [RESOLVED] Hiding Update Button for Expired Ads.

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.

[RESOLVED] Hiding Update Button for Expired Ads.

More
8 years 6 months ago - 8 years 6 months ago #22259 by mshihan
Hi

To validate ads by administrator I have set ads automatically update to " No ", and validation on update to "Yes", It is working during posting new ads and users updating their ads which were previously posted but not expired. The problem is any expired ads can update and published by the users themselves. To do this the users first have to click update ads and then click save. After clicking the save button the users have to click renew button to publish ads by themselves. How to hide the "update" button for expired ads or how to solve this issue?

Kind Regards
Last edit: 8 years 6 months ago by loic.
More
8 years 6 months ago #22266 by juloaadmin
Replied by juloaadmin on topic Hiding Update Button for Expired Ads.
You can do some custom code in myads/tmpl/default.php
check ad status to display the button are not
More
8 years 6 months ago - 8 years 6 months ago #22269 by mshihan
Replied by mshihan on topic Hiding Update Button for Expired Ads.
Sir, could you please tell me the code I have to edit?
I think this is the code.
<a href="<?php echo $target?>" class="btn btn-success"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> <?php echo JText::_('ADSMANAGER_RENEW_CONTENT')?></a>
Last edit: 8 years 6 months ago by mshihan.
More
8 years 6 months ago #22288 by loic
Replied by loic on topic Hiding Update Button for Expired Ads.
Hello,

In the myads view, you can find the code managing the expiration at the line 187 to 194, after that, you can add an else to that if and display the update button here.

That way, the update button will only be displayed if the renew button isn't displayed.

Of course, you need to remove the original update button.

Best regards.
More
8 years 6 months ago #22312 by mshihan
Replied by mshihan on topic Hiding Update Button for Expired Ads.
Could you please give me the code I have to enter, and will you fix this on your next version of adsmanager.?

Kind Regards
More
8 years 6 months ago #22323 by loic
Replied by loic on topic Hiding Update Button for Expired Ads.
Hello,

Try that in the file components/com_adsmanager/views/myads/tmpl/default.php, lines 173 to 196:
                        $target = TRoute::_("index.php?option=com_adsmanager&task=delete&catid=".$content->catid."&id=$content->id");
                        echo "<a onclick='return confirm(\"".htmlspecialchars(JText::_('ADSMANAGER_CONFIRM_DELETE'),ENT_QUOTES)."\")' href='".$target."'>".JText::_('ADSMANAGER_CONTENT_DELETE')."</a>";
                        if (ADSMANAGER_SPECIAL == "duplicate"){
                            echo "<br/>";
                            $target = TRoute::_("index.php?option=com_adsmanager&task=duplicate&catid=".$content->catid."&id=$content->id");
                            echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_DUPLICATE')."</a>";
                        }
                        if ($this->conf->expiration == 1) { 
                            if ($content->expiration_date != null) {
                                $expiration_time = strtotime($content->expiration_date);
                                $current_time = time();
                                if ($expiration_time - $current_time <= ($conf->recall_time * 3600 *24)) {
                                    if(function_exists('countRenewDurations') && countRenewDurations() > 1){
                                        $target = TRoute::_("index.php?option=com_adsmanager&view=expiration&id=$content->id");
                                    } else {
                                        $target = TRoute::_("index.php?option=com_adsmanager&task=renew&id=$content->id");
                                    }
                                    echo "<br/><a href='".$target."'>".JText::_('ADSMANAGER_RENEW_CONTENT')."</a>";
                                }else{
                                    echo "<br/>";
                                    $target = TRoute::_("index.php?option=com_adsmanager&task=write&catid=".$content->catid."&id=$content->id");
                        echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_EDIT')."</a>";
 
                                }
                            }
                        }

Please, be aware that I didn't test this code.

I will see if this issue is on the current version and will fix it if it is.

Best regards.
Time to create page: 0.152 seconds
Powered by Kunena Forum