amette_: joined #tikiwiki
left #tikiwiki
joined #tikiwiki
left #tikiwiki fabricius: joined #tikiwiki
joined #tikiwiki
joined #tikiwiki chibaguy: joined #tikiwiki
polom Kolle: joined #tikiwiki
@fabricius hey
i am back :) we've already chatted on friday
are you there? robertokir: joined #tikiwiki Kolle: hey guys, concerning the dynamic content part..
where do i put the =id?
cant find that part fabricius: joined #tikiwiki luciash: polom
Hi Kolle Kolle: hi luciash
maybe you can help me as well? i managed to create dynamic blocks
but i dont know where to include them via the content=x option amette_: joined #tikiwiki jonnyb: joined #tikiwiki arildb: joined #tikiwiki luciash: Kolle: in wiki page I suppose
https://doc.tiki.org/Dynamic-Content Kolle: yes, i did it :) works fine
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? juststrollingin: joined #tikiwiki luciash: Kolle: yes, sure thing :)
Kolle: pretty sure you can google something out Kolle: i did, it is possible :) the problem is that i dont know where to embed the script
do i have to create a new plugin? luciash: what is it? PHP?
what is the script written in? Kolle: i have the old script from our old wiki
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
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
the output for november was something like this: Incony AG Webmail Service Wed Nov 1 00:01:03 CET 2017:6021
so the number was generated on nov 1 around 00.01
and the number itself is 6021
and i need exactly this for the tiki wiki :)
but i struggle with the scriopt itself since i am an absolute noob at programming
according to the tiki faq, you can build your own plugins using PHP..
i found something like : <?php echo rand() . "n"; echo rand() . "n"; echo rand(5, 15); ?>
but i think this string only generates random numbers. i need them to be generated on the first of every month luciash: you need to use cron for that
or some online service like easycron
to run the script every month Kolle: hmmm
how do i "connect" this cron with the tiki?
ah nevermind, cron will just execute my script
ok ill dig further into it, thank you so far 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} fabricius: joined #tikiwiki Kolle: hey luciash, thank you for the guide
ill try it luciash: Kolle: (I assume that command/script was run monthly using cron too) lhtseng: joined #tikiwiki robertokir: joined #tikiwiki fabricius: Hi Kolle Kolle: hi fabricius amette_: left #tikiwiki
joined #tikiwiki fabricius: Kolle: put it on a wiki page or in a module Kolle: y i managed to setup the dynamic tasks; it works very good. i tested it
so a message will be displayed on the first of every month at 5 o clock in the morning fabricius: Kolle: {content id=1 label="some text"} <- this on a wiki page Kolle: my problem now is the random 4 digit number
luciash described it quite good but still i cant manage this stuff
i have no idea where to put the script
and how to associate it with the tiki wiki 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}
whhat script you refer to? Kolle: this is the old 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
and luciash suggested something like this:
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} torsten1: joined #tikiwiki fabricius: joined #tikiwiki Kolle: fabricius seems to have connection issues :/
i was hoping for his guidance fabricius: joined #tikiwiki
joined #tikiwiki
Kolle: sry, I have been distracted .. just reading now
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? Kolle: hey, no problem!
the purpose is to generate a random 4 digit number
once every month, preferably on the first
and yes it should only be displayed in the wiki site and updatet on the server fabricius: But it has to be / is calculated on the server?
ok
but do you want to display the script or the 4-digits? Kolle: well, i dont know. if it works on the site, im totally ok with that as well
i only need the 4 digits
in our old wiki, the 4 digits were only displayed in the source code of the webpage fabricius: so the output of the script could be another file, ex a tpl as luciash says Kolle: yes, absolutely
it either can be a .php or a .tpl file i think 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 Kolle: i think so, yes
it was a basic html file in our old wiki
here is the old code again, maybe it helps
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
the last part is not that important since we are moving our wiki and thus the folder also changed 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
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
the output code then need to be simply like "write the result in that file and overwrite he existing content
should be some simple command line magic Kolle: simple for you ;D
sounds very complicated 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
IF the import works
(include) Kolle: "only linux" :D 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? 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
never coded anything
this is because there are many questions which im sorry for.. bothering you guys with basic stuff luciash: Kolle: if it is still running periodically, you could just change the file where it is written to as I suggested Kolle: luciash, we have an old kind of "wiki"
where the number is generated
but we are migrating our whole database to the tiki wiki luciash: Kolle: and how do you run the script? Kolle: via cron luciash: Kolle: if you do not know how to modify it you will need to ask someone
Kolle: or learn ;) Kolle: well, i am learning and do not want to ask my boss everything luciash: so you know there is the command "crontab -e" to edit it ? 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? Kolle: i wish i could add screenshots here
would explain a lot more fabricius: Kolle: I think we have an imagination 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
my job is
to "create" a new one inside tiki wiki
to do exactly the same as the old one
only implemented into tiki wiki luciash: Kolle: this is not "how it works" 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"
the next and last thing is to generate the 4 digit number similar to the senteces on the first of every month 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 Kolle: ahhhh ok
that sounds good
now i think i got it fabricius: luciash Kolle : my picture:
a script creates a random 4 digit when it runs
a cronjob runs the script every month (ex. 1st day)
the script writes the result (4 digits) into another file (ex: 4-digits.tpl)
the Tiki fetches the content by using the include plugin
{include file="../../script/4-digits.tpl"} luciash: Kolle: then you can remove the <!-- comments --> syntax if you want it displayed in Tiki module or whatever Kolle: ooomg yes! luciash: <!-- is what makes it hidden Kolle: this cleared up a lot fabricius
it is only hidden in the wiki, not in the source code, right?
i think thats the purpose since nobody should be able to see the digits in plain text luciash: it is hidden in the browser Kolle: yes, right luciash: because it is syntax for HTML comments jonnyb: joined #tikiwiki Kolle: ok guys
i will try it tomorrow! 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? Kolle: it wopuld be best if they are not, yes
since it is a "admion only" wiki, it wouldnt be that bad fabricius: so why you want to include them?
I do not get that point Kolle: they were not visible in the browser before, but in the "source code" of the page
it was hidden in there fabricius: ah Kolle: because the number is a part of a important password
thank you so far guys, i am leaviong for now. hopefully we can talk tomorrow :) but again, you helped me a lot!! <3<3
see you and unlimited thanks 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
so gone!
what do you think about the last luciash? -: 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 luciash: but anyway, glad to help ;) fabricius: :DDD -: fabricius thinks about the same as luciash ... at least regarding "obscurely hidden parts of important passwords" ... luciash: I suppose they have some pattern and only that part of the password changes monthly so they can easily change password frequently
but I do not understand why they hide it in HTML comment :) fabricius: exactly
joined #tikiwiki Telesight: joined #tikiwiki jonnyb: joined #tikiwiki RadoS: joined #tikiwiki jonnyb: joined #tikiwiki robertokir: joined #tikiwiki fabricius: joined #tikiwiki robertokir: joined #tikiwiki