[01:08] amette_ left #tikiwiki [01:08] amette_ joined #tikiwiki [02:20] amette_ left #tikiwiki [02:20] amette_ joined #tikiwiki [02:36] amette_ left #tikiwiki [02:41] fabricius joined #tikiwiki [07:37] fabricius joined #tikiwiki [08:31] fabricius joined #tikiwiki [09:20] chibaguy joined #tikiwiki [09:20] chibaguy polom [09:30] Kolle joined #tikiwiki [09:34] Kolle @fabricius hey [09:34] Kolle i am back :) we've already chatted on friday [09:35] Kolle are you there? [09:46] robertokir joined #tikiwiki [09:53] Kolle hey guys, concerning the dynamic content part.. [09:53] Kolle where do i put the =id? [09:53] Kolle cant find that part [10:25] fabricius joined #tikiwiki [10:35] luciash polom [10:36] luciash Hi Kolle [10:38] Kolle hi luciash [10:38] Kolle maybe you can help me as well? i managed to create dynamic blocks [10:39] Kolle but i dont know where to include them via the content=x option [11:29] amette_ joined #tikiwiki [11:49] jonnyb joined #tikiwiki [12:08] arildb joined #tikiwiki [12:23] luciash Kolle: in wiki page I suppose [12:24] luciash https://doc.tiki.org/Dynamic-Content [12:31] Kolle yes, i did it :) works fine [12:54] Kolle hey guys its me again. my next issue is a bit more difficult.. is it possible to create a script which generates a 4 digit number every month, randomly? [13:22] juststrollingin joined #tikiwiki [13:43] luciash Kolle: yes, sure thing :) [13:43] luciash Kolle: pretty sure you can google something out [13:44] Kolle i did, it is possible :) the problem is that i dont know where to embed the script [13:44] Kolle do i have to create a new plugin? [13:45] luciash what is it? PHP? [13:45] luciash what is the script written in? [13:47] Kolle i have the old script from our old wiki [13:47] Kolle export RND=$(echo ${RANDOM:0:4})&&export MDATE=$(echo `date`)&&perl -i.bak -pe 's@.*Incony.*$@\<\!-- Incony AG Webmail Service $ENV{"MDATE"}:$ENV{"RND"} --\>@' /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc [13:50] Kolle the script was saved in a HTML file when i am not wrong.. if you wanted to view the number, you had to open the source code of the wiki [13:50] Kolle the output for november was something like this: Incony AG Webmail Service Wed Nov 1 00:01:03 CET 2017:6021 [13:50] Kolle so the number was generated on nov 1 around 00.01 [13:51] Kolle and the number itself is 6021 [13:51] Kolle and i need exactly this for the tiki wiki :) [13:51] Kolle but i struggle with the scriopt itself since i am an absolute noob at programming [13:52] Kolle according to the tiki faq, you can build your own plugins using PHP.. [13:52] Kolle i found something like : [13:53] Kolle but i think this string only generates random numbers. i need them to be generated on the first of every month [13:53] luciash you need to use cron for that [13:54] luciash or some online service like easycron [13:54] luciash to run the script every month [13:54] Kolle hmmm [13:54] Kolle how do i "connect" this cron with the tiki? [13:55] Kolle ah nevermind, cron will just execute my script [13:55] Kolle ok ill dig further into it, thank you so far [14:04] luciash Kolle: I think you could also use the same script as before (it seems to be a perl script) just instead of output to /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc you could write the number in templates/something.tpl file and then just have your own custom Tiki module display it using {include file=something.tpl} [14:17] fabricius joined #tikiwiki [14:33] Kolle hey luciash, thank you for the guide [14:34] Kolle ill try it [14:36] luciash Kolle: (I assume that command/script was run monthly using cron too) [14:51] lhtseng joined #tikiwiki [15:03] robertokir joined #tikiwiki [15:18] fabricius Hi Kolle [15:19] Kolle hi fabricius [15:25] amette_ left #tikiwiki [15:25] amette_ joined #tikiwiki [15:25] fabricius Kolle: put it on a wiki page or in a module [15:26] Kolle y i managed to setup the dynamic tasks; it works very good. i tested it [15:27] Kolle so a message will be displayed on the first of every month at 5 o clock in the morning [15:27] fabricius Kolle: {content id=1 label="some text"} <- this on a wiki page [15:27] Kolle my problem now is the random 4 digit number [15:27] Kolle luciash described it quite good but still i cant manage this stuff [15:27] Kolle i have no idea where to put the script [15:28] Kolle and how to associate it with the tiki wiki [15:29] fabricius Kolle: you can place this on several places and most likely nest it in other plugin snippets like {DIV()}{content id=1 label="some text"}{DIV} or {BOX()}{content id=1 label="some text"}{BOX} [15:30] fabricius whhat script you refer to? [15:30] Kolle this is the old script: [15:30] Kolle export RND=$(echo ${RANDOM:0:4})&&export MDATE=$(echo `date`)&&perl -i.bak -pe 's@.*Incony.*$@\<\!-- Incony AG Webmail Service $ENV{"MDATE"}:$ENV{"RND"} --\>@' /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc [15:30] Kolle and luciash suggested something like this: [15:31] Kolle I think you could also use the same script as before (it seems to be a perl script) just instead of output to /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc you could write the number in templates/something.tpl file and then just have your own custom Tiki module display it using {include file=something.tpl} [16:00] torsten1 joined #tikiwiki [16:20] fabricius joined #tikiwiki [16:39] Kolle fabricius seems to have connection issues :/ [16:39] Kolle i was hoping for his guidance [17:01] fabricius joined #tikiwiki [17:17] fabricius joined #tikiwiki [17:19] fabricius Kolle: sry, I have been distracted .. just reading now [17:21] fabricius Kolle: what is the purpose of the script on your Tiki site? Is it only to be displayed in the wiki and updated on the server? [17:21] Kolle hey, no problem! [17:21] Kolle the purpose is to generate a random 4 digit number [17:21] Kolle once every month, preferably on the first [17:22] Kolle and yes it should only be displayed in the wiki site and updatet on the server [17:22] fabricius But it has to be / is calculated on the server? [17:22] fabricius ok [17:23] fabricius but do you want to display the script or the 4-digits? [17:23] Kolle well, i dont know. if it works on the site, im totally ok with that as well [17:23] Kolle i only need the 4 digits [17:23] Kolle in our old wiki, the 4 digits were only displayed in the source code of the webpage [17:23] fabricius so the output of the script could be another file, ex a tpl as luciash says [17:23] Kolle yes, absolutely [17:24] Kolle it either can be a .php or a .tpl file i think [17:25] fabricius and the target file can contain html code ... some or none or much ... thus you can do everything with the file you do with template files [17:25] Kolle i think so, yes [17:25] Kolle it was a basic html file in our old wiki [17:26] Kolle here is the old code again, maybe it helps [17:26] Kolle export RND=$(echo ${RANDOM:0:4})&&export MDATE=$(echo `date`)&&perl -i.bak -pe 's@.*Incony.*$@\<\!-- Incony AG Webmail Service $ENV{"MDATE"}:$ENV{"RND"} --\>@' /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc [17:26] Kolle the last part is not that important since we are moving our wiki and thus the folder also changed [17:27] fabricius Kolle: I suggest that you setup a few files with only one or few lines, just to determine the differences - a .txt file with "Text" as content an .html with a coloured div etc. and then experiment to include those file in a wikipge with the include plugin, that luciash mentioned above [17:29] fabricius After that you only need to adjust the script to output into the file ... maybe a textfile or template file with only the 4 digits as single content would do the job [17:29] fabricius the output code then need to be simply like "write the result in that file and overwrite he existing content [17:30] fabricius should be some simple command line magic [17:31] Kolle simple for you ;D [17:31] Kolle sounds very complicated [17:33] fabricius not really - I am not a coder and not a high-level sysadmin, even using Linux only ... I could ask a fiend here in the community who maybe could add a line ... it is most likely not complicated and one or few lines of not much code [17:33] fabricius IF the import works [17:34] fabricius (include) [17:34] Kolle "only linux" :D [17:35] luciash Kolle: it is not clear to me where you get the script source from. Is it still running on the server where the Tiki is installed now? Or just from some internal documentation? [17:35] Kolle i have used windows my whole life. i started my apprenticeship 3 months ago and are pretty new to all thuis stuff. had my first linux sessions using only code without a GUI which was a huge achievement for me :D [17:35] Kolle never coded anything [17:36] Kolle this is because there are many questions which im sorry for.. bothering you guys with basic stuff [17:36] luciash Kolle: if it is still running periodically, you could just change the file where it is written to as I suggested [17:36] Kolle luciash, we have an old kind of "wiki" [17:36] Kolle where the number is generated [17:36] Kolle but we are migrating our whole database to the tiki wiki [17:37] luciash Kolle: and how do you run the script? [17:37] Kolle via cron [17:37] luciash Kolle: if you do not know how to modify it you will need to ask someone [17:37] luciash Kolle: or learn ;) [17:38] Kolle well, i am learning and do not want to ask my boss everything [17:38] luciash so you know there is the command "crontab -e" to edit it ? [17:38] fabricius luciash: I assume that the file needs to be on the same mashine, best "besides" the Tiki to work without a hussle and that it needs to write ths digits into a second file. Then the Tiki can include the second files content and does not display the code aswell. Am I about right? [17:38] Kolle i wish i could add screenshots here [17:38] Kolle would explain a lot more [17:38] fabricius Kolle: I think we have an imagination [17:39] Kolle i will try to explain the best i can again from the beginning: a script is executed via cron. to be specific, this script: export RND=$(echo ${RANDOM:0:4})&&export MDATE=$(echo `date`)&&perl -i.bak -pe 's@.*Incony.*$@\<\!-- Incony AG Webmail Service $ENV{"MDATE"}:$ENV{"RND"} --\>@' /srv/www/htdocs/H3.1/horde/templates/common-header-sidebar.inc [17:39] Kolle my job is [17:39] Kolle to "create" a new one inside tiki wiki [17:39] Kolle to do exactly the same as the old one [17:40] Kolle only implemented into tiki wiki [17:40] luciash Kolle: this is not "how it works" [17:40] Kolle i managed to setup the dynamic tasks (on the first of every month, a sentence will be displayed in a special page i created" [17:40] Kolle the next and last thing is to generate the 4 digit number similar to the senteces on the first of every month [17:41] luciash Kolle: you need to modify or add copy of the script (actually it is a command, not a script) in the crontab (cron) and change the path, where it outputs the output of the command (as I suggested) to the Tiki path [17:41] Kolle ahhhh ok [17:42] Kolle that sounds good [17:42] Kolle now i think i got it [17:42] fabricius luciash Kolle : my picture: [17:42] fabricius a script creates a random 4 digit when it runs [17:42] fabricius a cronjob runs the script every month (ex. 1st day) [17:42] fabricius the script writes the result (4 digits) into another file (ex: 4-digits.tpl) [17:42] fabricius the Tiki fetches the content by using the include plugin [17:42] fabricius {include file="../../script/4-digits.tpl"} [17:42] luciash Kolle: then you can remove the syntax if you want it displayed in Tiki module or whatever [17:42] Kolle ooomg yes! [17:42] luciash <\!-- is what makes it hidden [17:42] Kolle this cleared up a lot fabricius [17:43] Kolle it is only hidden in the wiki, not in the source code, right? [17:43] Kolle i think thats the purpose since nobody should be able to see the digits in plain text [17:43] luciash it is hidden in the browser [17:43] Kolle yes, right [17:43] luciash because it is syntax for HTML comments [17:43] jonnyb joined #tikiwiki [17:44] Kolle ok guys [17:44] Kolle i will try it tomorrow! [17:44] fabricius ah Kolle: maybe an important information from you to us: did you say, that the 4-digits shall NOT be visible in the browser? [17:44] Kolle it wopuld be best if they are not, yes [17:45] Kolle since it is a "admion only" wiki, it wouldnt be that bad [17:45] fabricius so why you want to include them? [17:45] fabricius I do not get that point [17:45] Kolle they were not visible in the browser before, but in the "source code" of the page [17:45] Kolle it was hidden in there [17:45] fabricius ah [17:46] Kolle because the number is a part of a important password [17:47] Kolle thank you so far guys, i am leaviong for now. hopefully we can talk tomorrow :) but again, you helped me a lot!! <3<3 [17:47] Kolle see you and unlimited thanks [17:47] fabricius you could display them, but limit the visibility of the page to a group or to the Admins .. whilst they are all Admins ... what is the point to hide their information from themselves to make it necessary to open the sourcecode and read it there? I am just curious about this curius type of security ... sounds like security by obscurity [17:48] fabricius so gone! [17:48] fabricius what do you think about the last luciash? [17:48] * luciash thinks anything that is "part of an important password" should not be just "hidden" in the page source which can be seen by anyone hitting ctrl+U in their browser [17:48] luciash but anyway, glad to help ;) [17:48] fabricius :DDD [17:49] * fabricius thinks about the same as luciash ... at least regarding "obscurely hidden parts of important passwords" ... [17:50] luciash I suppose they have some pattern and only that part of the password changes monthly so they can easily change password frequently [17:52] luciash but I do not understand why they hide it in HTML comment :) [17:53] fabricius exactly [18:06] fabricius joined #tikiwiki [18:54] Telesight joined #tikiwiki [19:28] jonnyb joined #tikiwiki [21:20] RadoS joined #tikiwiki [21:33] jonnyb joined #tikiwiki [22:27] robertokir joined #tikiwiki [23:01] fabricius joined #tikiwiki [23:27] robertokir joined #tikiwiki