Project "Tuxbox-GIT: apps":

The branch, master has been updated
       via  5e284d6b1c1f3f4be4995e9e420f1f65912d7806 (commit)
      from  34529ba9a5d364d7ba9c71364614248e651eef21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5e284d6b1c1f3f4be4995e9e420f1f65912d7806
Author: GetAway <get-a...@t-online.de>
Date:   Sat May 9 21:02:17 2015 +0200

    yWeb: port "Tuxbox.DisplayLogos" from martii & svenhofer
    
    now support for jpg, and gif logos
    as an example: start nfs share of Coolstream Logo-Dir
    and mount it with your dbox.
    set dir of logos in yWeb/Settings/Webserver ;)
    
    Signed-off-by: GetAway <get-a...@t-online.de>

diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.cpp 
b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.cpp
index 13710ca..15646a6 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.cpp
@@ -424,3 +424,24 @@ std::string 
CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep)
        return result;
 }
 
+//-------------------------------------------------------------------------
+std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id 
channelId) {
+       std::string channelIdAsString = string_printf( 
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS , channelId & 0xFFFFFFFFFFFFULL);
+       std::string channelName = GetServiceName(channelId);
+//     replace(channelName, " ", "_");
+       _logoURL+="/";
+       if (access((_logoURL + channelName + ".png").c_str(), 4) == 0)
+               return _logoURL + channelName + ".png";
+       else if (access((_logoURL + channelName + ".jpg").c_str(), 4) == 0)
+               return _logoURL + channelName + ".jpg";
+       else if (access((_logoURL + channelName + ".gif").c_str(), 4) == 0)
+               return _logoURL + channelName + ".gif";
+       else if(access((_logoURL + channelIdAsString + ".png").c_str(), 4) == 0)
+               return _logoURL + channelIdAsString + ".png";
+       else if (access((_logoURL + channelIdAsString + ".jpg").c_str(), 4) == 
0)
+               return _logoURL + channelIdAsString + ".jpg";
+       else if (access((_logoURL + channelIdAsString + ".gif").c_str(), 4) == 
0)
+               return _logoURL + channelIdAsString + ".gif";
+       else
+               return "";
+}
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.h 
b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.h
index c4898bc..9dd9c7c 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.h
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoapi.h
@@ -75,6 +75,7 @@ class CNeutrinoAPI
 
        std::string timerEventType2Str(CTimerd::CTimerEventTypes type);
        std::string timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep);
+       std::string getLogoFile(std::string _logoURL, t_channel_id channelId);
 
 public:
        CNeutrinoAPI();
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp 
b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
index 0378b0e..7b54c6f 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
@@ -74,7 +74,6 @@ THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile 
*Config, CStringList
        ConfigList["ExtrasDocumentURL"] = Config->getString("ExtrasDocURL", 
EXTRASDOCUMENTURL);
 //     ConfigList["NewGui"]            = Config->getString("NewGui", "true");
        ConfigList["Zapit_XML_Path"]    = Config->getString("Zapit_XML_Path", 
ZAPITXMLPATH);
-        ConfigList["TUXBOX_LOGOS_URL"]= Config->getString("Tuxbox.LogosURL", 
TUXBOX_LOGOS_URL);
         
         if (Config->getInt32("configfile.version") < 3)
         {
@@ -99,6 +98,7 @@ const CNeutrinoYParser::TyFuncCall 
CNeutrinoYParser::yFuncCallList[]=
        {"get_channels_as_dropdown",    
&CNeutrinoYParser::func_get_channels_as_dropdown},
        {"get_bouquets_with_epg",       
&CNeutrinoYParser::func_get_bouquets_with_epg},
        {"get_actual_channel_id",       
&CNeutrinoYParser::func_get_actual_channel_id},
+       {"get_logo_name",               &CNeutrinoYParser::func_get_logo_name},
        {"get_mode",                    &CNeutrinoYParser::func_get_mode},
        {"get_video_pids",              &CNeutrinoYParser::func_get_video_pids},
        {"get_audio_pid",               &CNeutrinoYParser::func_get_radio_pid},
@@ -317,7 +317,7 @@ std::string 
CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
        std::string timestr;
        bool have_logos = false;
        
-       if(!hh->WebserverConfigList["TUXBOX_LOGOS_URL"].empty())
+       if (!hh->WebserverConfigList["Tuxbox.LogosURL"].empty() && 
hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" )
                have_logos = true;
        CZapitClient::BouquetChannelList::iterator channel = 
channellist->begin();
        for (; channel != channellist->end(); ++channel)
@@ -330,14 +330,34 @@ std::string 
CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
 
                std::string bouquetstr = (BouquetNr >= 0) ? ("&amp;bouquet=" + 
itoa(BouquetNr)) : "";
                yresult += "<tr>";
-               if(have_logos)
-                       yresult += string_printf("<td class=\"%c\" width=\"44\" 
rowspan=\"2\"><a href=\"javascript:do_zap('"
-                                       PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
-                                       "')\"><img class=\"channel_logo\" 
src=\"%s/"
-                                       PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
-                                       ".gif\" alt=\"%s\"/></a></td>", 
classname, channel->channel_id, 
-                                       
(hh->WebserverConfigList["TUXBOX_LOGOS_URL"]).c_str(),
-                                       channel->channel_id, channel->name);
+
+               if(have_logos) {
+                       std::string channel_logo = 
NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], 
channel->channel_id);
+                       std::string zaplink;
+                       if (channel_logo.empty())
+                               zaplink = channel->name;
+                       else
+                               zaplink = string_printf(
+                                               "<img class=\"channel_logo\" 
src=\"%s\" title=\"%s\" alt=\"%s\" />"
+                                               , channel_logo.c_str()
+                                               , channel->name
+                                               , channel->name
+                                       );
+
+                       yresult += string_printf(
+                                       "<td class=\"%c logo_cell %s\" 
width=\"44\" rowspan=\"2\">"
+                                       "<a 
href=\"javascript:do_zap('"PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS"')\">"
+                                       "%s"
+                                       "</a>"
+                                       "</td>"
+                                       , classname
+                                       , (channel_logo.empty() ? "no_logo" : 
"")
+                                       , channel->channel_id
+                                       , zaplink.c_str()
+                                       , channel->name
+                                       , channel->name
+                               );
+               }
                
                /* timer slider */
                if(event && event->duration > 0)
@@ -466,6 +486,20 @@ std::string  
CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler */*hh*/,
 {
        return 
string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,NeutrinoAPI->Zapit->getCurrentServiceID());
        
 }
+
+//-------------------------------------------------------------------------
+// func: Get Logo Name
+//-------------------------------------------------------------------------
+std::string  CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, 
std::string channelId)
+{
+       if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") {
+               t_channel_id cid;
+               if (1 == sscanf(channelId.c_str(), "%llx", &cid))
+                       return 
NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid);
+       }
+       return "";
+}
+
 //-------------------------------------------------------------------------
 // y-func : get_mode (returns tv|radio|unknown)
 //-------------------------------------------------------------------------
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.h 
b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.h
index de2b52c..97a10de 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.h
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.h
@@ -36,6 +36,7 @@ private:
        std::string func_get_actual_bouquet_number(CyhookHandler *hh, 
std::string para);
        std::string func_get_channels_as_dropdown(CyhookHandler *hh, 
std::string para);
        std::string func_get_actual_channel_id(CyhookHandler *hh, std::string 
para);
+       std::string func_get_logo_name(CyhookHandler *hh, std::string para);
        std::string func_get_bouquets_with_epg(CyhookHandler *hh, std::string 
para);
        std::string func_get_mode(CyhookHandler *hh, std::string para);
        std::string func_get_video_pids(CyhookHandler *hh, std::string para);
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/Y_Blocks.txt 
b/tuxbox/neutrino/daemons/nhttpd/web/Y_Blocks.txt
index b43d0fb..8bd4289 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/Y_Blocks.txt
+++ b/tuxbox/neutrino/daemons/nhttpd/web/Y_Blocks.txt
@@ -54,6 +54,7 @@ start-block~nhttpd_save_settings
 
{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=}
 
{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=}
 {=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}~cache=}
+{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=}
 
{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=}
 {=func:do_reload_httpd_config=}
 end-block~nhttpd_save_settings
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/Y_Boxcontrol_Channellist.yhtm 
b/tuxbox/neutrino/daemons/nhttpd/web/Y_Boxcontrol_Channellist.yhtm
index 195ca2f..302f9cd 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/Y_Boxcontrol_Channellist.yhtm
+++ b/tuxbox/neutrino/daemons/nhttpd/web/Y_Boxcontrol_Channellist.yhtm
@@ -10,8 +10,7 @@ function do_zap(channelid)
 }
 function do_epg(channelid)
 {
-       
window.location.href="Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channelid;
-//     window.open("Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channelid, 
"epg", "width=400");
+       
window.location.href="Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channelid+"&logoid="+logoid;
 }
 function do_streaminfo()
 {
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/Y_Live_EPG.yhtm 
b/tuxbox/neutrino/daemons/nhttpd/web/Y_Live_EPG.yhtm
index ddc7860..ffd79f1 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/Y_Live_EPG.yhtm
+++ b/tuxbox/neutrino/daemons/nhttpd/web/Y_Live_EPG.yhtm
@@ -50,11 +50,9 @@ function show_info(_index)
 }
 function check_logo()
 {
-       
{=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;ExtrasDocRoot=}~web~~
-       var test = 
loadSyncURL("{=ini-get:/var/tuxbox/config/nhttpd.conf;ExtrasDocURL=}/logos/{=channel=}.gif");
-       if(test != "")
-       =}
+       {=if-empty:{=logoid=}~~
                show_obj("logo",true);
+       =}
 }
 function show_epg() {
        show_waitbox(true);
@@ -108,7 +106,7 @@ function _show_epg()
        <table id="epglist" class="y_invisible_table" cellpadding="4" 
cellspacing="0" width="100%">
        <thead align="left">
        <tr>
-               <th colspan="2"><img id="logo" 
src="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL=}/{=channel=}.gif"
 style="visibility:hidden">&nbsp;</th>
+               <th colspan="2"><img id="logo" src="{=func:get_logo_name 
{=channel=}=}" style="visibility:hidden; max-width: 50px;"/></th>
                
<th>{=L:0035=}</th><th>{=L:0036=}</th><th>{=L:0037=}</th><th>{=L:0038=}</th>
        </tr>
        </thead>
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/Y_Settings_nhttpd.yhtm 
b/tuxbox/neutrino/daemons/nhttpd/web/Y_Settings_nhttpd.yhtm
index 27bdf6d..29434b4 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/Y_Settings_nhttpd.yhtm
+++ b/tuxbox/neutrino/daemons/nhttpd/web/Y_Settings_nhttpd.yhtm
@@ -8,6 +8,7 @@ function form_init()
        obj_set_radio_value('authenticate', 
"{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}");
        obj_set_radio_value('threading', 
"{=ini-get:/var/tuxbox/config/nhttpd.conf;webserver.threading;false=}");
        obj_set_radio_value('mod_sendfile_sendAll', 
"{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;false=}");
+       obj_set_radio_value('Tuxbox_DisplayLogos', 
"{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;true=}");
 }
 function do_submit()
 {
@@ -22,6 +23,13 @@ function do_submit()
                document.f.submit();
        }
 }
+function do_check_input_LogosURL()
+{
+       if(document.getElementById('Tuxbox_DisplayLogos').checked == true)
+               document.f.Tuxbox_LogosURL.readOnly = false;
+       else
+               document.f.Tuxbox_LogosURL.readOnly = true;
+}
 //]]>
 </script>
 </head>
@@ -93,6 +101,13 @@ function do_submit()
                        </tr>
                        <tr><td colspan="2" 
class="y_form_header">{=L:0008=}</td></tr>
                        <tr>
+                               <td>{=L:1523=}</td>
+                               <td>
+                                       <input type="radio" 
name="Tuxbox_DisplayLogos" value="false" onClick="do_check_input_LogosURL()" 
/>{=L:0032=}&nbsp;
+                                       <input type="radio" 
name="Tuxbox_DisplayLogos" value="true" onClick="do_check_input_LogosURL()" 
id="Tuxbox_DisplayLogos" />{=L:0031=}
+                               </td>
+                       </tr>
+                       <tr>
                                <td>{=L:1513=}</td>
                                <td><input type="text" name="Tuxbox_LogosURL" 
size="60" 
value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL~cache=}" 
title="{=L:1512=}" /></td>
                        </tr>
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/Y_Version.txt 
b/tuxbox/neutrino/daemons/nhttpd/web/Y_Version.txt
index 8ba32a4..362fee4 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/Y_Version.txt
+++ b/tuxbox/neutrino/daemons/nhttpd/web/Y_Version.txt
@@ -1,4 +1,4 @@
-version=2.8.2.32
+version=2.8.3.00
 date=09.05.2015
 type=Release
 info=Tuxbox
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/languages/Deutsch 
b/tuxbox/neutrino/daemons/nhttpd/web/languages/Deutsch
index 83b8702..ebd6da9 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/languages/Deutsch
+++ b/tuxbox/neutrino/daemons/nhttpd/web/languages/Deutsch
@@ -394,6 +394,7 @@
 1520=Server Konfiguration
 1521=Passwort muss mind. 4 Zeichen haben
 1522=Port muss angegeben werden
+1523=Logos anzeigen
 
 #========= Settings yWeb
 1600=IP Adresse eingeben (xxx.xxx.xxx.xxx)
diff --git a/tuxbox/neutrino/daemons/nhttpd/web/languages/English 
b/tuxbox/neutrino/daemons/nhttpd/web/languages/English
index f565052..871bc3e 100644
--- a/tuxbox/neutrino/daemons/nhttpd/web/languages/English
+++ b/tuxbox/neutrino/daemons/nhttpd/web/languages/English
@@ -394,6 +394,7 @@
 1520=Server Configuration
 1521=Password must have 4 letters at minimum
 1522=Port is required
+1523=Show Logos
 
 #=========Settings yWeb
 1600=enter IP (xxx.xxx.xxx.xxx)
diff --git a/tuxbox/neutrino/daemons/nhttpd/yconfig.h 
b/tuxbox/neutrino/daemons/nhttpd/yconfig.h
index c5355aa..b680951 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yconfig.h
+++ b/tuxbox/neutrino/daemons/nhttpd/yconfig.h
@@ -191,8 +191,6 @@
 #define UPLOAD_TMP_FILE                "/tmp/upload.tmp"
 #define CACHE_DIR                      "/tmp/.cache"
 
-#define TUXBOX_LOGOS_URL                ""
-
 #endif
 //-----------------------------------------------------------------------------
 // Configurations for AVM FritzBox
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp 
b/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
index a8e6b9b..2ae9eea 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
@@ -488,6 +488,28 @@ void Cyhttpd::ReadConfig(void)
        ConfigList["WebsiteMain.directory"] = 
Config->getString("WebsiteMain.directory", PRIVATEDOCUMENTROOT);
        ConfigList["WebsiteMain.override_directory"] = 
Config->getString("WebsiteMain.override_directory", PUBLICDOCUMENTROOT);
        ConfigList["WebsiteMain.hosted_directory"] = 
Config->getString("WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT);
+
+       // Logos
+       ConfigList["Tuxbox.DisplayLogos"] = 
Config->getString("Tuxbox.DisplayLogos", "true");
+       // Check location of logos
+       if (Config->getString("Tuxbox.LogosURL", "").empty()) {
+#ifdef Y_CONFIG_USE_HOSTEDWEB
+               if (access((ConfigList["WebsiteMain.hosted_directory"] + 
"/logos").c_str(), R_OK) == 0){
+                       Config->setString("Tuxbox.LogosURL", 
ConfigList["WebsiteMain.hosted_directory"] + "/logos");
+                       have_config = false; //save config
+               }
+#endif
+               else if (access((ConfigList["WebsiteMain.override_directory"] + 
"/logos").c_str(), R_OK) == 0) {
+                       Config->setString("Tuxbox.LogosURL", 
ConfigList["WebsiteMain.override_directory"] + "/logos");
+                       have_config = false; //save config
+               }
+               else if (access((ConfigList["WebsiteMain.directory"] + 
"/logos").c_str(), R_OK) == 0){
+                       Config->setString("Tuxbox.LogosURL", 
ConfigList["WebsiteMain.directory"] + "/logos");
+                       have_config = false; //save config
+               }
+       }
+       ConfigList["Tuxbox.LogosURL"] = Config->getString("Tuxbox.LogosURL", 
"");
+
 #ifdef Y_CONFIG_USE_OPEN_SSL
        ConfigList["SSL"]               = Config->getString("WebsiteMain.ssl", 
"false");
        ConfigList["SSL_pemfile"]       = 
Config->getString("WebsiteMain.ssl_pemfile", SSL_PEMFILE);

-----------------------------------------------------------------------

Summary of changes:
 .../daemons/nhttpd/tuxboxapi/neutrinoapi.cpp       |   21 ++++++++
 .../daemons/nhttpd/tuxboxapi/neutrinoapi.h         |    1 +
 .../daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp   |   54 ++++++++++++++++----
 .../daemons/nhttpd/tuxboxapi/neutrinoyparser.h     |    1 +
 tuxbox/neutrino/daemons/nhttpd/web/Y_Blocks.txt    |    1 +
 .../nhttpd/web/Y_Boxcontrol_Channellist.yhtm       |    3 +-
 tuxbox/neutrino/daemons/nhttpd/web/Y_Live_EPG.yhtm |    8 +--
 .../daemons/nhttpd/web/Y_Settings_nhttpd.yhtm      |   15 ++++++
 tuxbox/neutrino/daemons/nhttpd/web/Y_Version.txt   |    2 +-
 .../neutrino/daemons/nhttpd/web/languages/Deutsch  |    1 +
 .../neutrino/daemons/nhttpd/web/languages/English  |    1 +
 tuxbox/neutrino/daemons/nhttpd/yconfig.h           |    2 -
 tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp          |   22 ++++++++
 13 files changed, 112 insertions(+), 20 deletions(-)


-- 
Tuxbox-GIT: apps

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Tuxbox-cvs-commits mailing list
Tuxbox-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits

Reply via email to