Changeset 42622 for titan


Ignore:
Timestamp:
08/04/18 04:24:23 (6 years ago)
Author:
obi
Message:

tithek add description support step 1

Location:
titan/plugins/tithek
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/ard.h

    r35596 r42622  
    169169                                writesys(menu, line, 0);
    170170                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    171                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     171                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    172172                                ret = 0;
    173173                        }
  • titan/plugins/tithek/filmon.h

    r28659 r42622  
    5656                                writesys(menu, line, 0);
    5757                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    58                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     58                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    5959                                ret = 0;
    6060                        }
  • titan/plugins/tithek/internetradio.h

    r27270 r42622  
    5656                                writesys(menu, line, 0);
    5757                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    58                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     58                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    5959                                ret = 0;
    6060                        }
  • titan/plugins/tithek/internettv.h

    r27270 r42622  
    5656                                writesys(menu, line, 0);
    5757                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    58                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     58                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    5959                                ret = 0;
    6060                        }
  • titan/plugins/tithek/kinox.h

    r42127 r42622  
    225225                                writesys(menu, line, 0);
    226226                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    227                                 createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     227                                createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    228228                                ret = 0;
    229229                        }
     
    293293                                writesys(menu, line, 0);
    294294                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    295                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     295                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    296296                                ret = 0;
    297297                        }
     
    612612                                       
    613613                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    614                 createtithek(tnode, tnode->title,  tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     614                createtithek(tnode, tnode->title,  tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    615615                ret = 0;
    616616        }
     
    969969
    970970                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    971                 createtithek(tnode, tnode->title,  tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     971                createtithek(tnode, tnode->title,  tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    972972                ret = 0;
    973973        }
     
    10751075                                writesys(menu, line, 0);
    10761076                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    1077                                 createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     1077                                createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    10781078                                ret = 0;
    10791079                        }
  • titan/plugins/tithek/netzkino.h

    r27270 r42622  
    5656                                writesys(menu, line, 0);
    5757                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    58                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     58                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    5959                                ret = 0;
    6060                        }
  • titan/plugins/tithek/tithek.c

    r42123 r42622  
    129129                addconfigtmp("tithek_kinox_localhoster", "2");
    130130
    131         if(getconfigint("tithek_kinox_pic", NULL) == NULL)
     131        if(getconfig("tithek_kinox_pic", NULL) == NULL)
    132132                addconfigtmp("tithek_kinox_pic", "1");
    133133
     
    136136//      else
    137137//              screentithekplay("http://ks387398.kimsufi.com/mediathek/mainmenu.list", _("Tithek - Mainmenu"), 1);
     138//              screentithekmenu("http://atemio.dyndns.tv/mediathek/mainmenu.list", _("Tithek - Mainmenu"), 1);
    138139                screentithekplay("http://atemio.dyndns.tv/mediathek/mainmenu.list", _("Tithek - Mainmenu"), 1);
    139140
  • titan/plugins/tithek/tithek.h

    r42030 r42622  
    167167        char* localname;
    168168        char* menutitle;
     169        char* description;
    169170        int flag;
    170171        struct tithek* prev;
     
    183184        node->localname = NULL;
    184185        node->menutitle = NULL;
     186        node->description = NULL;
    185187        node->flag = 0;
    186188}
     
    213215                                        case 3: node->menutitle = tmpstr; break;
    214216                                        case 4: flag = tmpstr; break;
     217                                        case 5: node->description = tmpstr; break;
    215218                                }
    216219
     
    222225        }
    223226
    224         if(ret != 5)
     227        if(ret != 5 && ret != 6)
    225228        {
    226229                if(count > 0)
     
    383386}
    384387
    385 struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
     388struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, char* description, int flag)
    386389{
    387390        int pay = 0;
     
    396399        localname = stringreplacechar(localname, '#', ' ');
    397400        menutitle = stringreplacechar(menutitle, '#', ' ');
     401        description = stringreplacechar(description, '#', ' ');
    398402
    399403        tmpstr = ostrcat(tmpstr, title, 1, 0);
     
    408412        tmpstr = ostrcat(tmpstr, "#", 1, 0);
    409413        tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1);
     414        tmpstr = ostrcat(tmpstr, "#", 1, 0);
     415        tmpstr = ostrcat(tmpstr, description, 1, 0);
    410416
    411417        tmpstr = string_replace_all("\n", "", tmpstr, 1);
     
    781787}
    782788
     789
     790int createtithekmenu(char* titheklink, struct skin* menu, struct skin* listbox)
     791{
     792        struct skin* tmp = NULL;
     793        char* tithekfile = NULL;
     794        char* tithekpic = NULL;
     795        int localfile = 0;
     796
     797//      tithekfile = tithekdownload(titheklink);
     798        if(!ostrncmp("http://", titheklink, 7))
     799                tithekfile = tithekdownload(titheklink, NULL, HTTPAUTH, 0, 0);
     800        else
     801        {
     802                tithekfile = ostrcat(titheklink, NULL, 0, 0);
     803                localfile = 1;
     804        }
     805
     806        delmarkedscreennodes(menu, 1);
     807
     808        freetithek();
     809
     810//      if(readtithek(tithekfile) != 0) return 1;
     811        int linecount = readtithek(tithekfile);
     812
     813        struct tithek* titheknode = tithek;
     814
     815        while(titheknode != NULL)
     816        {
     817                tmp = addlistbox(menu, listbox, tmp, 1);
     818                if(tmp != NULL)
     819                {
     820                        tmp->type = MENU;
     821                        tmp->textposx = 80;
     822                        tmp->valign = MIDDLE;
     823                        changetext(tmp, titheknode->title);
     824                        tmp->height = 50;
     825                        tmp->hspace = 10;
     826                        tithekpic = tithekdownload(titheknode->pic, NULL, HTTPAUTH, 0, 0);
     827                        tmp->picwidth = 1;
     828                        tmp->picheight = 1;
     829
     830                        changepic(tmp, tithekpic);
     831                        free(tithekpic); tithekpic = NULL;
     832                        tmp->handle = (char*)titheknode;
     833                }
     834                titheknode = titheknode->next;
     835        }
     836
     837        if(localfile == 0)
     838                unlink(tithekfile);
     839
     840        free(tithekfile); tithekfile = NULL;
     841        return 0;
     842}
     843
     844void screentithekmenu(char* titheklink, char* title, int first)
     845{
     846        int rcret = -1, oaktline = 1, oaktpage = -1;
     847
     848        struct skin* menu = getscreen("tithekmenu");
     849        struct skin* listbox = getscreennode(menu, "listbox");
     850        if(titheklink == NULL) return;
     851
     852        listbox->aktpage = -1;
     853        listbox->aktline = 1;
     854
     855        if(createtithekmenu(titheklink, menu, listbox) != 0) return;
     856        drawscreen(menu, 2, 0);
     857        addscreenrc(menu, listbox);
     858
     859        while(1)
     860        {
     861                rcret = waitrc(menu, 0, 0);
     862
     863                if(rcret == getrcconfigint("rcexit", NULL)) break;
     864
     865                if(rcret == getrcconfigint("rcok", NULL))
     866                {
     867                        if(listbox->select != NULL && listbox->select->handle != NULL)
     868                        {
     869                                oaktpage = listbox->aktpage;
     870                                oaktline = listbox->aktline;
     871                                clearscreen(menu);
     872                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
     873                                if(((struct tithek*)listbox->select->handle)->flag == 1)
     874                                        screentithekplay(tmpstr, title, first);
     875                                else
     876                                        screentithekmenu(tmpstr, title, first);
     877
     878                                free(tmpstr); tmpstr = NULL;
     879                                if(createtithekmenu(titheklink, menu, listbox) != 0) break;
     880
     881                                listbox->aktpage = oaktpage;
     882                                listbox->aktline = oaktline;
     883                                drawscreen(menu, 0, 0);
     884                                addscreenrc(menu, listbox);
     885                        }
     886                }
     887        }
     888
     889        freetithek();
     890        delmarkedscreennodes(menu, 1);
     891        delownerrc(menu);
     892        clearscreen(menu);
     893}
     894
     895
    783896int createtithekplay(char* titheklink, struct skin* grid, struct skin* listbox, struct skin* countlabel, char* title, int flag)
    784897{
     
    10541167
    10551168//void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    1056 void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
     1169void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, char* description, int flag)
    10571170{
    1058 
    10591171debug(99, "removefav title: %s", title);
    10601172debug(99, "removefav menutitle: %s", menutitle);
     
    10751187        input = ostrcat(input, "#", 1, 0);
    10761188        input = ostrcat(input, oitoa(flag), 1, 1);
     1189        input = ostrcat(input, "#", 1, 0);
     1190        input = ostrcat(input, description, 1, 0);
    10771191
    10781192        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
     
    11301244
    11311245//void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    1132 void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
     1246void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* description, int flag)
    11331247{
    11341248        int count = 0, i = 0;
     
    12121326        input = ostrcat(input, "#", 1, 0);
    12131327        input = ostrcat(input, oitoa(flag), 1, 1);
     1328        input = ostrcat(input, "#", 1, 0);
     1329        input = ostrcat(input, description, 1, 0);
     1330
    12141331        // tithek security
    12151332        input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1);
     
    12541371
    12551372//void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    1256 void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
     1373void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* description, int flag)
    12571374{
    12581375        int rcret = 0, type = 0;
     
    12651382        struct skin* skin_menutitle = getscreennode(tithekedit, "menutitle");
    12661383        struct skin* skin_type = getscreennode(tithekedit, "type");
     1384        struct skin* skin_description = getscreennode(tithekedit, "description");
    12671385
    12681386        struct skin* tmp = NULL;
     
    12751393        changeinput(skin_menutitle, menutitle);
    12761394        changeinput(skin_type, oitoa(type));
     1395        changeinput(skin_description, description);
    12771396
    12781397        addscreenrc(tithekedit, listbox);
     
    12931412                        drawscreen(load, 0, 0);
    12941413//                      addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, fullmenutitle, atoi(skin_type->ret));
    1295                         addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret));
     1414                        addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, skin_description->ret, atoi(skin_type->ret));
    12961415                        clearscreen(load);
    12971416                        break;
     
    13031422}
    13041423
    1305 int showinfo(struct skin* listbox, char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
     1424int showinfo(struct skin* listbox, char* title, char* link, char* pic, char* localname, char* menutitle, char* description, int flag)
    13061425{
    13071426        int ret = 1;
     
    13181437        tmpstr = ostrcat(tmpstr, "#", 1, 0);
    13191438        tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1);
     1439        tmpstr = ostrcat(tmpstr, "#", 1, 0);
     1440        tmpstr = ostrcat(tmpstr, description, 1, 0);
     1441
    13201442        // tithek security
    13211443//      tmpstr = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", tmpstr, 1);
     
    13301452        {
    13311453                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    1332                 createtithek(tnode, tnode->title, savefile, tnode->pic, tnode->localname,
    1333 tnode->menutitle, tnode->flag);
     1454                createtithek(tnode, tnode->title, savefile, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    13341455                ret = 0;
    13351456        }
     
    15691690{
    15701691        int flag = 0;
    1571         int debuglevel = getconfigint("debuglevel", NULL);
     1692//      int debuglevel = getconfigint("debuglevel", NULL);
    15721693        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL;
    15731694        drawscreen(load, 0, 0);
     
    19682089        free(tmpstr1); tmpstr1 = NULL;
    19692090}
     2091
    19702092void screentithekplay(char* titheklink, char* title, int first)
    19712093{
     
    22152337                                                tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
    22162338                                                if(textbox(_("Message"), _("Add this sub folder as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
    2217                                                         addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, check);
     2339                                                        addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, NULL, check);
    22182340                                                free(tmpstr), tmpstr = NULL;
    22192341                                                free(tmpstr1), tmpstr1 = NULL;
     
    24032525                                                tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
    24042526                                                if(textbox(_("Message"), _("Add this sub folder as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
    2405                                                         addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, check);
     2527                                                        addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, NULL, check);
    24062528                                                free(tmpstr), tmpstr = NULL;
    24072529                                                free(tmpstr1), tmpstr1 = NULL;
     
    27632885                        if(listbox->select != NULL && listbox->select->handle != NULL)
    27642886                        {
    2765                                 if(showinfo(listbox, ((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag) == 0)
     2887                                if(showinfo(listbox, ((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->description, ((struct tithek*)listbox->select->handle)->flag) == 0)
    27662888                                        if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
    27672889                        }
     
    27752897                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
    27762898                                {
    2777                                         removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag);
     2899                                        removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->description, ((struct tithek*)listbox->select->handle)->flag);
    27782900//                                      removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag);
    27792901
     
    27942916                                {
    27952917//                                      addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag);
    2796                                         addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag);
     2918                                        addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->description, ((struct tithek*)listbox->select->handle)->flag);
    27972919                                }
    27982920                        }
     
    28072929                                {
    28082930//                                      editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag);
    2809                                         editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag);
     2931                                        editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->description, ((struct tithek*)listbox->select->handle)->flag);
    28102932                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0);
    28112933                                        if(pagecount == 0) return;
  • titan/plugins/tithek/tithek_global.h

    r42619 r42622  
    879879                                writesys(menu, line, 0);
    880880                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    881                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     881                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    882882                                ret = 0;
    883883                        }
     
    14231423{
    14241424        debug(99, "link: %s", link);
    1425         int ret = 1;
     1425//      int ret = 1;
    14261426        char* tmpstr = NULL, *streamurl = NULL;
    14271427
     
    14841484//                      writesys(menu, tmpstr, 0);
    14851485                        struct tithek* tnode = (struct tithek*)listbox->select->handle;
    1486                         createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     1486                        createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    14871487                        ret = 0;
    14881488                }
  • titan/plugins/tithek/xvideos.h

    r42196 r42622  
    100100                                writesys(menu, line, 0);
    101101                                struct tithek* tnode = (struct tithek*)listbox->select->handle;
    102                                 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     102                                createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->description, tnode->flag);
    103103                                ret = 0;
    104104                        }
Note: See TracChangeset for help on using the changeset viewer.