[Version 2 Release] RaspberryPints - Digital Taplist Solution

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Again, it's a reasonable conclusion to reach when the only information source shows a pull-up, given there's no otherwise conclusive information from the manufacturer. The authors of those two sites are likely in the same boat as we are ;)

So...wrt pulled-up inputs on the ATmega328. I could be wrong but I don't think the pull-ups are invoked for inputs by default. To invoke a pull-up the pinmode declaration needs to be INPUT_PULLUP, and that's not what's in the raspberrypints.ino file...

Cheers!
 
Again, it's a reasonable conclusion to reach when the only information source shows a pull-up, given there's no otherwise conclusive information from the manufacturer. The authors of those two sites are likely in the same boat as we are ;)

So...wrt pulled-up inputs on the ATmega328. I could be wrong but I don't think the pull-ups are invoked for inputs by default. To invoke a pull-up the pinmode declaration needs to be INPUT_PULLUP, and that's not what's in the raspberrypints.ino file...

Cheers!
So if the pinmode was not set and @jbinbama does not have the pull up he has a floating input and that is why he sometimes does not register pours and some times he gets random ghost pours.
 
Ok, y'all drove me to this.

Among all the other SOC systems I have running in my world I had a Pi Zero W handy and a spare Alamode already wired up for meters/temp sensors/motion sensor/etc. And all of my RPi fleet runs the same SD card image, so it had R'Pints already running (without the flow meter hardware connected).

So I shut down the Pi, plugged the Alamode on top, powered them both up and plugged in an SF800 meter on digital IO 2. And connected one of my 'scopes.

Idle, there's a lovely flat 4.875 volt level on the pin. Blow softly through the meter and there's an equally lovely square wave.

Conclusion: there's no need for the pull-ups. Apparently (1) the Atmel chip has the pull-ups enabled even though the IDE documentation indicates otherwise, and (2) the somewhere between 20K-50K value is sufficient - at least for the 100cm cable I used for this check.

The OP has a gas problem...

Cheers!
 
It does appear to require external positive bias, yes.
Fortunately it appears the Atmel chip provides sufficient current to do the job well.
But I'm not 100% convinced about that, yet...

Cheers!
 
lol, no worries. It was a worthwhile issue to investigate and I had everything needed right in front of me.
So, I'm now convinced external pull-ups are not required. I realized I was so stuck on one line of code I didn't even look at the next.

Code:
for( int i = 0; i < numSensors; i++ ) {
    pinMode(pulsePin[i], INPUT);
    digitalWrite(pulsePin[i], HIGH);

The "digitalWrite" is what sets the pull-ups on the meter pins. Duh...

Cheers!
 
Which Raspbian version are you using? It would give a hint as to which version of Apache2 you have.
The version of Apache2 that was included in Wheezy had inbound html requests resolved by default in /var/www, so when you use just a host's ip address, that's the folder the request will land in. If your target file isn't there, it won't be found.

Otoh, Jessie and Stretch shipped with a version of Apache2 that changed the default folder to /var/www/html, so if you put your target file in /var/www, it won't be found.

That default folder is referred to as the Apache2 DocumentRoot. It is defined by /etc/apache2/sites-available/default.conf (Wheezy) or 000-default.conf (Jessie and Stretch). If you open the appropriate .conf file you'll see it sets DocumentRoot /var/www or DocumentRoot /var/www/html.

So, bottom line, figure out where Apache2 wants the files to go, and move them there. Or, edit the .conf file to change DocumentRoot to where you want...

Cheers!

Thanks for that. Am using Apache2. I ended up going back and reading a few extra pages worth. Starting with a fresh install of Stretch as I am concurrently running CraftBeerPi.
I got impatient and started again before I read your comment. Is the Zaepho (https://github.com/zaepho/RaspberryPints/wiki/Fresh-RaspberryPi-Stretch-Installation) method the best/easiest way to get it working on Stretch?
 
Last edited:
It does appear to require external positive bias, yes.
Fortunately it appears the Atmel chip provides sufficient current to do the job well.
But I'm not 100% convinced about that, yet...

Cheers!

The Atmel datasheet shows a Schmitt trigger on the input circuit so that should help but I think your previous comment about not relying on the internal pull-up is the right idea to ensure robustness. I am guessing most people building a raspberrypints don't have a oscilloscope to verify the wave shape so it would provide a bit more insurance for noise immunity.
 
Tried u/kcolby's method and ended up with this. Any ideas on how to fix? Thanks.

Validating Entries...Success!
Checking DB connectivity...
Warning: mysqli_connect(): (HY000/1698): Access denied for user 'root'@'localhost' in /var/www/html/install/includes/configprocessor.php on line 51
FAILED!
User: root
Server: localhost
Pass: raspberry
Array
(
[selectaction] => install
[servername] => localhost
[rootpass] => xxxx
[dbuser] => beers
[dbpass1] => xxxx
[dbpass2] => xxxx
[adminuser] => Brewery Name
[adminemail] => [email protected]
[adminname] => My Name
[adminpass1] => xxxx
[adminpass2] => xxxx
)

Checking folder permissions (/var/www/html/includes)...Success!

Cannot connect the the database using the supplied information. MySQL Error Number: 1698
Cannot write to the logs directory. Please check the /logs/ folder permissions. See the RPints Installation page on www.raspberrypints.com.
Cannot write to the template cache directory. Please check the /templates_c/ folder permissions. See the RPints Installation page on www.raspberrypints.com.

Please press the back button on your browser to fix these errors
 
Just wanted to update people in here for anyone else with a similar setup or situation. For my display I was using an amazon fire 8 tablet as a display because they are dirt cheap and loaded with options. Using fully kiosk browser I was displaying my pints homepage. Using fully the camera can detect motion and wake the screen as you approach so this makes this a super sweet raspberry pints display. The only thing I hated was I just had to set fully to refresh every few minutes since I couldn’t find a way to make a remote screen like that refresh. When it refreshes it caused a short flicker which looked weird and you didn’t get immediate feedback so that kind of bothered me. Well long story short I found out fully has a rest api and allows for remote control if you have it enabled. I edited my flow_monitor.py to send a web Request to the tablet running fully kiosk that causes it to immediately refresh after a pour. If anyone else has a similar setup I’d happily share what I did. I hope this helps.
 
Just wanted to update people in here for anyone else with a similar setup or situation. For my display I was using an amazon fire 8 tablet as a display because they are dirt cheap and loaded with options. Using fully kiosk browser I was displaying my pints homepage. Using fully the camera can detect motion and wake the screen as you approach so this makes this a super sweet raspberry pints display. The only thing I hated was I just had to set fully to refresh every few minutes since I couldn’t find a way to make a remote screen like that refresh. When it refreshes it caused a short flicker which looked weird and you didn’t get immediate feedback so that kind of bothered me. Well long story short I found out fully has a rest api and allows for remote control if you have it enabled. I edited my flow_monitor.py to send a web Request to the tablet running fully kiosk that causes it to immediately refresh after a pour. If anyone else has a similar setup I’d happily share what I did. I hope this helps.
I'd be interested in seeing how you did that! I'm also viewing my RPints via a remote screen (Nexus 10 tablet running kiosk mode).

Cheers,


Kal
 
Okay to set this up use fully kiosk browser for your tablets browser. In settings there is a setting to allow remote administration enable this and create a password for it. Its also probably best to give the tablet a static ip. Now that you enabled this it allows web commands to be sent to be sent to http://yourtabletip:2323 on your local network. You could test that it works using any other browser by going to the web address
http://yourtabletip:2323/?cmd=loadStartURL&type=json&password=yourpassword
the browser on the tablet should reload your start page.
To set up in raspberry pints navigate to /var/www/python and with nano create a file called refresh.py and paste the following.. making sure to put your password and yourtabletip. sorry I had this part in a code block but it kept messing up my code for some reason....
This is the part at the bottom that is displaying weird so I’ll just show it here as well outside the code block in case it isn’t showing right.
response = requests.post('yourtabletip/', data=data)

Code:
#!/usr/bin/python

import requests

def refresh():
  data = {
  'cmd': 'loadStartURL',
  'password': 'yourpassword'
  }
  response = requests.post('yourtabletip/', data=data)

save this file and I'm no py expert so I'm not sure if it has to be executable or not I just did it with sudo chmod + x refresh.py
next edit your flow_monitor.py file thats located in the same directory
at the top add this line to import your refresh.py function so we can call it
Code:
import refresh
and then further down you will see this line where the pulse count gets past on to pours.php under that just add the line refresh.refresh() this will call the function we made called refresh from our refresh.py file that basically just sends a curl command to the fully kiosk browser.

Code:
#The following 2 lines passes the PIN and PULSE COUNT to the php script
                        path = '/var/www/includes/pours.php'
                        subprocess.call(["php", path, MCP_PIN, POUR_COUNT])
                        refresh.refresh()

that should be it I rebooted to make sure everything was loaded properly.
 
Last edited:
Okay to set this up use fully kiosk browser for your tablets browser. In settings there is a setting to allow remote administration enable this and create a password for it. Its also probably best to give the tablet a static ip. Now that you enabled this it allows web commands to be sent to be sent to http://yourtabletip:2323 on your local network. You could test that it works using any other browser by going to the web address
http://yourtabletip:2323/?cmd=loadStartURL&type=json&password=yourpassword
the browser on the tablet should reload your start page.
To set up in raspberry pints navigate to /var/www/python and with nano create a file called refresh.py and paste the following.. making sure to put your password and your ip.

Code:
#!/usr/bin/python
import requests

def refresh():
  data = {
  'cmd': 'loadStartURL',
  'password': 'yourpassword'
  }
  response = requests.post('yourtabletip/', data=data)

save this file and I'm no py expert so I'm not sure if it has to be executable or not I just did it with sudo chmod + x refresh.py
next edit your flow_monitor.py file thats located in the same directory
at the top add this line to import your refresh.py function so we can call it
Code:
import refresh
and then further down you will see this line where the pulse count gets past on to pours.php under that just add the line refresh.refresh() this will call the function we made called refresh from our refresh.py file that basically just sends a curl command to the fully kiosk browser.

Code:
#The following 2 lines passes the PIN and PULSE COUNT to the php script
                        path = '/var/www/includes/pours.php'
                        subprocess.call(["php", path, MCP_PIN, POUR_COUNT])
                        refresh.refresh()

that should be it I rebooted to make sure everything was loaded properly.
Awesome! Thanks mate, I'll give this a crack tomorrow, when I have ~no~ less beers under my belt, and report back. Cheers, Kal.
 
So I decided to have even more fun with this.... there is another app called lannouncer that we use in the home automation community that you can use to make your tablet speak or play audio files. It works a similar way through an api. I made another .py file called homer.py and put the web call in there and referenced it just like I did the refresh in flow_monitor.py
So now after I pour a beer I get a tablet refresh and then homer says mmmmmm beer through the tablet speakers. I have attached a video showing it all work from the screen wake up all the way through a pour.. I forgot to mention the wake on camera motion is a native fully kiosk feature so no hacking is required...

 
Okay so I got screwing around too much and I did something that kept me from booting. My last sd card image was pretty old but I was able to get it working again. My question is the filesystem on the old sd card is still working and so subsequently I can access the tables in /var/lib/mysql but I cannot for the life of me figure out how use that backup. I can get the old databse to show up as an option in phpmyadmin but when i click on a table it says error file doesnt exist. the file exists so I am very confused.. Im sure im screwing up something with permissions or something silly. Does anyone know how I can restore from this method?
 
Just finished installing RandR's Pints but script wont go through if I select "Load Sample data" and when I dont and script does finish BUT 127.0.0.1/index.php wont show anything at all and administrator page wont let me log in, any idea where im wrong? thanks

When you select Load Sample Data does it give you an error?

Does the 127.0.0.1/index.php at least load the background? As for the admin page I'm wondering if the password you typed isn't being saved correctly.

It might be a good idea to remove includes/config.php and admin/includes/conn.php and then go to 127.0.0.1/index.php that should bring up the standard install page that will allow you to enter in your information without going through the script.
 
[...]My question is the filesystem on the old sd card is still working and so subsequently I can access the tables in /var/lib/mysql but I cannot for the life of me figure out how use that backup. [...]Does anyone know how I can restore from this method?

fwiw, I have my systems running RaspberryPints copy their local database file (/var/lib/mysql/ibdata1) up to a network share every night at 12:05 AM. I have successfully used that network copy to restore a running tap list a few times over the years. Just stop mysql, copy the network file back to the local system, make sure the permissions are correct, then restart mysql.

Obviously this depends on the local machine having a fully functional mysql that just needs the database file updated or restored...

Cheers!
 
fwiw, I have my systems running RaspberryPints copy their local database file (/var/lib/mysql/ibdata1) up to a network share every night at 12:05 AM. I have successfully used that network copy to restore a running tap list a few times over the years. Just stop mysql, copy the network file back to the local system, make sure the permissions are correct, then restart mysql.

Obviously this depends on the local machine having a fully functional mysql that just needs the database file updated or restored...

Cheers!
I was able to get it working by changing permissions so I could copy it to my laptop using an sd card reader then sent it to the pi stopped MySQL deleted the whole MySQL folder and replaced with the new one. Changed permissions back to MySQL and restarted the server. I swear I tried just the ibdata1 file but maybe I screwed up a permission or something. Does it not need the stuff in the raspberry pints folder but just the ibdata1? I’m just confused why it was so hard for me to get right. But this definitely makes me interested in how you are backing it up do you Care to share how you have the pi sending this backup automatically?
 
Thank goodness for Google search, as I wrote up my automagic backup thing ~three years ago and didn't want to that again ;)
https://www.homebrewtalk.com/forum/...-taplist-solution.487694/page-29#post-6945842

The only file I've had to back up is the ibdata1 file and restoring or replacing it always brings the tap list to life again. The other files in that folder are the original log files while I've never backed up or restored/replaced. And the rest of the installation must be functional, obviously, or you're going to have to clone the whole works from somewhere to get going again...

Cheers!
 
Okay to set this up use fully kiosk browser for your tablets browser. In settings there is a setting to allow remote administration enable this and create a password for it. Its also probably best to give the tablet a static ip. Now that you enabled this it allows web commands to be sent to be sent to http://yourtabletip:2323 on your local network. You could test that it works using any other browser by going to the web address
http://yourtabletip:2323/?cmd=loadStartURL&type=json&password=yourpassword
the browser on the tablet should reload your start page.
To set up in raspberry pints navigate to /var/www/python and with nano create a file called refresh.py and paste the following.. making sure to put your password and yourtabletip. sorry I had this part in a code block but it kept messing up my code for some reason....
This is the part at the bottom that is displaying weird so I’ll just show it here as well outside the code block in case it isn’t showing right.
response = requests.post('yourtabletip/', data=data)

Code:
#!/usr/bin/python

import requests

def refresh():
  data = {
  'cmd': 'loadStartURL',
  'password': 'yourpassword'
  }
  response = requests.post('yourtabletip/', data=data)

save this file and I'm no py expert so I'm not sure if it has to be executable or not I just did it with sudo chmod + x refresh.py
next edit your flow_monitor.py file thats located in the same directory
at the top add this line to import your refresh.py function so we can call it
Code:
import refresh
and then further down you will see this line where the pulse count gets past on to pours.php under that just add the line refresh.refresh() this will call the function we made called refresh from our refresh.py file that basically just sends a curl command to the fully kiosk browser.

Code:
#The following 2 lines passes the PIN and PULSE COUNT to the php script
                        path = '/var/www/includes/pours.php'
                        subprocess.call(["php", path, MCP_PIN, POUR_COUNT])
                        refresh.refresh()

that should be it I rebooted to make sure everything was loaded properly.

Awesome stuff, works perfectly.

Thanks for the share!
 
Sooo... I just acquired a raspberry Pi from a friend and was planning on installing raspberrypints on it. However when going to the site to get the installation instructions and download I'm receiving an account suspended error and can't browse the site. Has the site been sunset in the last few days?!?!?
 
Sooo... I just acquired a raspberry Pi from a friend and was planning on installing raspberrypints on it. However when going to the site to get the installation instructions and download I'm receiving an account suspended error and can't browse the site. Has the site been sunset in the last few days?!?!?

The original site has been down for a few months now, but the code is still available at https://github.com/RaspberryPints/RaspberryPints

Though it hasn't been updated in a few years, others have taken it and done updates to their one branches in GitHub.

For example you could take mine (https://github.com/rtlindne/RaspberryPints) it has text files for the instructions in the base directory or an Linux install script in the util directory that will setup the Pi with all the software and configuration needed (its been awhile since I ran it so hopefully it still works)
 
Hi all! I've been super happy with this Rpints setup. I have messed with it a lot, Still not a pro. This is an easy question. when I put a beer on tap the info from the beer should auto populate the fields that are filled out from the beer info, SRM, ABV, ETc.. well some where along my journey it has stopped and I have to manually enter that info in again, seem like a permissions issue or something simple. Please let me know what you think.
 
Wrt the beer info not populating, the most common cause is using tabs or hard returns inside the Tasting Notes box. Work backward chronologically through your beers and make sure each Tasting Notes field is just a stream of "normal" unformatted text.

The tap number row is a .png image file with a "transparent" background appended to the index.php file.
Here's what the tail of that file looks like:

Code:
<style type="text/css">
<!--
img.size{
    width:100%;
    height:auto;
}
-->
</style>
<img class="size" src="img/tap_numbers.png" alt="">


[fwiw, I'm in NJ all week babysitting grandkids and pulled up that file data using WinSCP from the RPi that runs the cold side of my humble brewery. Connectivity is awesome :D]

Cheers!
 
Kal,
I made the changes to my style.css and index.php files, and I downloaded all the images into the SRM folder, but when I rebooted my RPI and it opened, there were no glass images and the hop showing the ibu count only showed 1/2 of the hop. If I send youu my style.css file and index.php file could you take a look at them to see if I missed something? Thanks.
 
Last edited:
Kal,
I made the changes to my style.css and index.php files, and I downloaded all the images into the SRM folder, but when I rebooted my RPI and it opened, there were glass images and the hop showing the ibu count only showed 1/2 of the hop. If I send youu my style.css file and index.php file could you take a look at them to see if I missed something? Thanks.
Sure, send them over.

It's 5am here at the moment and I'm busy until midday, but I can look at them this afternoon for you.

Cheers,

Kal

P.S. Send a screenshot of what you are experiencing as that'll definitely speed up the troubleshooting process.
 
Thanks Kal,
Heres the files for whenever you get a chance. thanks in advance.
 

Attachments

  • indexmod.php.txt
    18.5 KB · Views: 34
  • stylemod.css.txt
    7.5 KB · Views: 78
Kal,
Here’s a photo of how it displays with the modified files and how it looked before the modified files were used.
 

Attachments

  • 01D9CA2A-53BC-4931-9FE1-99AB0133220B.jpeg
    01D9CA2A-53BC-4931-9FE1-99AB0133220B.jpeg
    1.5 MB · Views: 136
  • 9F9EB0ED-A141-43B7-885C-429A1489135E.jpeg
    9F9EB0ED-A141-43B7-885C-429A1489135E.jpeg
    1.4 MB · Views: 120
Thanks Kal,
Heres the files for whenever you get a chance. thanks in advance.
Hey G-Man,

Had a bit of spare time between the gym this morning and my daughter's dentist appointment at lunchtime so I've had a quick look at your files.

Only two minor things (one in each file), in your style.css file you pasted the SRM code in the middle of a IBV attribute so that effectively broke both (lines 194 - 315 are located inside the ibu-indicator), so I've shifted this for you. The other issue was that you only replaced the SRM code in the "Nothing on Tap" section at the bottom of your index.php file, so I've replaced it in the top section as well for you.

Once you rename and upload these, you'll need to do a hard refresh (CTRL+F5) to load the new CSS.

Let me know if that cures all your ills, or if I've overlooked anything?

Cheers,

Kal
 

Attachments

  • indexmod.php.txt
    23.6 KB · Views: 38
  • stylemod.css.txt
    7.4 KB · Views: 74
Hey G-Man,

Had a bit of spare time between the gym this morning and my daughter's dentist appointment at lunchtime so I've had a quick look at your files.

Only two minor things (one in each file), in your style.css file you pasted the SRM code in the middle of a IBV attribute so that effectively broke both (lines 194 - 315 are located inside the ibu-indicator), so I've shifted this for you. The other issue was that you only replaced the SRM code in the "Nothing on Tap" section at the bottom of your index.php file, so I've replaced it in the top section as well for you.

Once you rename and upload these, you'll need to do a hard refresh (CTRL+F5) to load the new CSS.

Let me know if that cures all your ills, or if I've overlooked anything?

Cheers,

Kal
Kal,

Once again you saved my bacon. I don't do much with .php & .css files, but I thought I had did it correctly. Thanks for the quick turnaround.
GMan-62
 
Kal,

Once again you saved my bacon. I don't do much with .php & .css files, but I thought I had did it correctly. Thanks for the quick turnaround.
GMan-62
All good mate, they are literally different languages, so happy I could help!

Cheers,

Kal
 
BTW, looking at your screenshots I went with the assumption that you always have a beer listed on every row (as you have a coming soon logo for your empty tap).

If you ever decide that you do want to be able to display empty rows you'll need to replace the second SRM section at the bottom of you index.php file with the following:

PHP:
                                <?php if($config[ConfigNames::ShowSrmCol]){ ?>
                                    <td class="srm">
                                        <h3></h3>                                      
                                        <div class="srm-container">
                                            <div class="srm-indicator"></div>
                                        </div>
                                      
                                        <h2></h2>
                                    </td>
                                <?php } ?>

Cheers,

Kal
 
BTW, looking at your screenshots I went with the assumption that you always have a beer listed on every row (as you have a coming soon logo for your empty tap).
If you ever decide that you do want to be able to display empty rows you'll need to replace the second SRM section at the bottom of you index.php file with the following:

PHP:
                                <?php if($config[ConfigNames::ShowSrmCol]){ ?>
                                    <td class="srm">
                                        <h3></h3>                                     
                                        <div class="srm-container">
                                            <div class="srm-indicator"></div>
                                        </div>
                                     
                                        <h2></h2>
                                    </td>
                                <?php } ?>

Cheers,

Kal

Kal,
Will that go at the very bottom, or do I need to insert it between lines?
 
Kal,
Will that go at the very bottom, or do I need to insert it between lines?
Replace the following code from lines 393 - 481:

PHP:
                                <?php if($config[ConfigNames::ShowSrmCol]){ ?>
                                    <td class="srm">
                                        <h3><?php echo $beer['og']; ?> OG</h3>
                                        <?php
                                            $ebc = $beer['srm'];
                                            ?>
                                        <?php
                                        $srmImgClass = "";
                                        if( $ebc < 1 ) {
                                            $srmImgClass = "srm-0"; }
                                        else if( $ebc < 2 )
                                            $srmImgClass = "srm-1";
                                        else if( $ebc < 3 )
                                            $srmImgClass = "srm-2";
                                        else if( $ebc < 4 )
                                            $srmImgClass = "srm-3";
                                        else if( $ebc < 5 )
                                            $srmImgClass = "srm-4";
                                        else if( $ebc < 6 )
                                            $srmImgClass = "srm-5";
                                        else if( $ebc < 7 )
                                            $srmImgClass = "srm-6";
                                        else if( $ebc < 8 )
                                            $srmImgClass = "srm-7";
                                        else if( $ebc < 9 )
                                            $srmImgClass = "srm-8";
                                        else if( $ebc < 10 )
                                            $srmImgClass = "srm-9";
                                        else if( $ebc < 11 )
                                            $srmImgClass = "srm-10";
                                        else if( $ebc < 12 )
                                            $srmImgClass = "srm-11";
                                        else if( $ebc < 13 )
                                            $srmImgClass = "srm-12";
                                        else if( $ebc < 14 )
                                            $srmImgClass = "srm-13";
                                        else if( $ebc < 15 )
                                            $srmImgClass = "srm-14";
                                        else if( $ebc < 16 )
                                            $srmImgClass = "srm-15";
                                        else if( $ebc < 17 )
                                            $srmImgClass = "srm-16";
                                        else if( $ebc < 18 )
                                            $srmImgClass = "srm-17";
                                        else if( $ebc < 19 )
                                            $srmImgClass = "srm-18";
                                        else if( $ebc < 20 )
                                            $srmImgClass = "srm-19";
                                        else if( $ebc < 21 )
                                            $srmImgClass = "srm-20";
                                        else if( $ebc < 22 )
                                            $srmImgClass = "srm-21";
                                        else if( $ebc < 23 )
                                            $srmImgClass = "srm-22";
                                        else if( $ebc < 24 )
                                            $srmImgClass = "srm-23";
                                        else if( $ebc < 25 )
                                            $srmImgClass = "srm-24";
                                        else if( $ebc < 26 )
                                            $srmImgClass = "srm-25";
                                        else if( $ebc < 27 )
                                            $srmImgClass = "srm-26";
                                        else if( $ebc < 28 )
                                            $srmImgClass = "srm-27";
                                        else if( $ebc < 29 )
                                            $srmImgClass = "srm-28";
                                        else if( $ebc < 30 )
                                            $srmImgClass = "srm-29";
                                        else if( $ebc < 31 )
                                            $srmImgClass = "srm-30";
                                        else if( $ebc < 32 )
                                            $srmImgClass = "srm-31";
                                        else if( $ebc < 33 )
                                            $srmImgClass = "srm-32";
                                        else if( $ebc < 34 )
                                            $srmImgClass = "srm-33";
                                        else if( $ebc < 35 )
                                            $srmImgClass = "srm-34";
                                        else if( $ebc < 36 )
                                            $srmImgClass = "srm-35";
                                        else if( $ebc >= 36 )
                                            $srmImgClass = "srm-36";
                                        ?>
                                        <div class="srm-container">
                                            <div class="srm-indicator"><div class="srm-indicator <?php echo $srmImgClass ?>"></div></div>
                                        </div>
                                        <h2><?php echo $beer['srm']; ?> SRM</h2>
                                    </td>
                                <?php } ?>
With this code instead:
PHP:
                                <?php if($config[ConfigNames::ShowSrmCol]){ ?>
                                    <td class="srm">
                                        <h3></h3>                                      
                                        <div class="srm-container">
                                            <div class="srm-indicator"></div>
                                            <div class="srm-stroke"></div>
                                        </div>
                                      
                                        <h2></h2>
                                    </td>
                                <?php } ?>
Cheers,

Kal
 
Back
Top