• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Calender text bg color based on ticket count

Calender text bg color based on ticket count 9 years 5 months ago #33174

  • massageindy
  • massageindy's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 2
When people see my calendar, they see all events equal. But in our case we dont confirm an event until it reaches a certain number of tickets sold.

Id like to highlight events with a background color to the event name if it has x number of tickets sold or more.

This code below achieves what I want and display the number effectively in SHOW and Default events pages.
<?php
$db = &JFactory::getDBO();
// Amount of Subscriptions
$db->setQuery("SELECT SUM(ut.quantity) FROM #__rseventspro_user_tickets ut LEFT JOIN #__rseventspro_users u ON ut.ids = u.id WHERE u.ide = '".$event->id."'");
$subs = $db->loadResult();?>
<p 
<?php if ($subs <= 5) echo 'style="color:red"'; ?>
<?php if ($subs > 5) echo 'style="color:green"'; ?>
<?php
echo '<b>';?>
<?php if ($subs == 0) echo '0'; ?>
<?php
echo ''.($subs);
echo ' Deposits Paid</b></br>';?>
<?php if ($featured) echo 'Lets Party! Time is set!.</p>'; ?>
<?php if ($subs <= 5) echo 'Need more to confirm party.</p>'; ?>

So i tried to add the same type of code to calendar default page and i just cant see why its not working. here it is below. Can you see any reason it shouldnt work?
<?php
$db = &JFactory::getDBO();
// Amount of Subscriptions
$db->setQuery("SELECT SUM(ut.quantity) FROM #__rseventspro_user_tickets ut LEFT JOIN #__rseventspro_users u ON ut.ids = u.id WHERE u.ide = '".$event->id."'");
$subs = $db->loadResult();?>
<span <?php if ($subs <= 5) echo 'class="event-name"'; ?><?php if ($subs > 5) echo 'class="highlight"'; ?>
 ><b><?php echo $this->escape($this->calendar->events[$event]->name); ?></b></span>
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!