Loading


Advertisement:

Author Topic: Set Premium AD from User Profile Page?!  (Read 122 times)

kirtaph

  • Newbie
  • *
  • Posts: 14
Set Premium AD from User Profile Page?!
« on: March 15, 2017, 08:23:51 pm »
Hi at all guys, I've made a web site for a Real Estate Agency using OSClass 3.7.1 and Wzestate Theme: www.tuaimmobiliare.it

I've a single problem with development, I've a single user that administrate entire site.From his profile page, he want to set Premium Ad to show in slideshow homepage.

I've use this code in loop-user-grid.php:

Code: [Select]
<?php
//$query = "UPDATE oc_t_item SET b_premium=";
                            
$set_premium_url= osc_admin_base_url(true).'?page=items&amp;action=status_premium&amp;id=';
$set_premium_url.=osc_item_ID().'&amp;'.osc_csrf_token_url().'&amp;value=';
if(osc_item_is_premium()){
$set_premium_url.='0';
?>

<a style="text-decoration:none;" href="<?php echo $set_premium_url?>" title="Rimuovi da Premium">
<i class="fa fa-star" aria-hidden="true"></i>
  </a>
<?php }else

$set_premium_url.='1';
?>

<a style="text-decoration:none;" href="<?php echo $set_premium_url?>" title="Aggiungi a Premium">
<i class="fa fa-star-o" aria-hidden="true"></i>
  </a>
&#10072;
<?php
}
?>

But for osc_csrf_token_url(); I'll must be logged in as admin in OSClass backend.

I'll show profile page that I realized:



Any Idea?!

PS: I'm sorry for bad written english, any help is appreciate!
« Last Edit: March 15, 2017, 08:25:47 pm by kirtaph »

kirtaph

  • Newbie
  • *
  • Posts: 14
Re: Set Premium AD from User Profile Page?!
« Reply #1 on: March 16, 2017, 03:14:33 pm »
I think that I use SQL Query to set premium directly without any fee! But how I can execute SQL direct on click?

Thanks