Jump to content

tivadarsubotica

Members
  • Posts

    17
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tivadarsubotica's Achievements

Member

Member (2/5)

0

Reputation

  1. In My post "Bilingual mod_rewrite" You explained me in a great way how can I use bilingual (or multilingual) pages in htaccess, so thats the right way how I understand the scripts...
  2. Yes, I know that I must to learn, the problem is time, time to do something that asking to me. Usual I ask for example, and then I see, how its work, than I can (step by step) learn and search for other solutions of my problems. If I had a solution to my question I know what are do up to now and adding a solution will see how can I go on if I had another problem. So, this is the way how I thinking...
  3. This is the problem, how can I do this, to click on submit and reload data without reload page and to page stay on same place where is it. Im wery "weak" with javascript aor Ajax... 😭
  4. I don’t know if it can be solved with Ajax or any other way Jus to see You should see how looks when is OFF and when is ON the button... The most important to page stay on the same place after submit to dont scrolling up or down... As You see I have in Form: index.php?c=listing_vesti#kajron_<?php echo $vesti_id; ?> what give me back the "clicked" on the top of the page, not on the same place where is clicked.
  5. Hi, I have a part of script, this is the form submitted with php and after submit, that reload the page. How can I do submit query without reload page (to page stay on same place where is it). <form action="index.php?c=listing_vesti#kajron_<?php echo $vesti_id; ?>" method="post"> <button type="submit" id="SubmitBTN" class="btn <?php echo $kajron_btn; ?>" name="kajronbtn"><input class="form-check-input" type="checkbox" id="kajron" name="kajron" value="<?php echo $vesti_kajron; ?>" <?php echo $kajron_checked; ?>>Kajron</button> <input type="hidden" id="vesti_id" name="vesti_id" value="<?php echo $vesti_id; ?>"> <input type="hidden" id="kajron" name="kajron" value="<?php echo $vesti_kajron; ?>"> </form> Thanks in advanced, T
  6. Hi, I have in column "keywords" comma separated keywords in one row/news. Example in ID "1" in column "keywords" have: "Šport, Fudbal, Četvrta Liga". I want to make a tag-s from those words to be like: http://site.com/tag/sport, http://site.com/tag/fudbal, http://site.com/tag/cetvrta-liga. At first I separate those words by: $input = $vest_keywords; $removed_spaces = preg_replace('/\s*,\s*/', ',', $input); $output = explode(',', $removed_spaces); foreach($output as $tags) { echo $tags; } This give me: Šport | Fudbal | Četvrta liga But I have a "slug-maker", and I have a problem with redeclare. /* SLUG */ $string = $output; function my_str_split($string) { $slen = strlen($string); for ($i = 0; $i < $slen; $i++) { $sArray[$i] = $string{$i}; } return $sArray; } function noDiacritics($string) { //cyrylic transcription $cyrylicFrom = array('А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'); $cyrylicTo = array('A', 'B', 'W', 'G', 'D', 'Ie', 'Io', 'Z', 'Z', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'Ch', 'C', 'Tch', 'Sh', 'Shtch', '', 'Y', '', 'E', 'Iu', 'Ia', 'a', 'b', 'w', 'g', 'd', 'ie', 'io', 'z', 'z', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'ch', 'c', 'tch', 'sh', 'shtch', '', 'y', '', 'e', 'iu', 'ia'); $from = array("Á", "À", "Â", "Ä", "Ă", "Ā", "Ã", "Å", "Ą", "Æ", "Ć", "Ċ", "Ĉ", "Č", "Ç", "Ď", "Đ", "Ð", "É", "È", "Ė", "Ê", "Ë", "Ě", "Ē", "Ę", "Ə", "Ġ", "Ĝ", "Ğ", "Ģ", "á", "à", "â", "ä", "ă", "ā", "ã", "å", "ą", "æ", "ć", "ċ", "ĉ", "č", "ç", "ď", "đ", "ð", "é", "è", "ė", "ê", "ë", "ě", "ē", "ę", "ə", "ġ", "ĝ", "ğ", "ģ", "Ĥ", "Ħ", "I", "Í", "Ì", "İ", "Î", "Ï", "Ī", "Į", "IJ", "Ĵ", "Ķ", "Ļ", "Ł", "Ń", "Ň", "Ñ", "Ņ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ő", "Ø", "Ơ", "Œ", "ĥ", "ħ", "ı", "í", "ì", "i", "î", "ï", "ī", "į", "ij", "ĵ", "ķ", "ļ", "ł", "ń", "ň", "ñ", "ņ", "ó", "ò", "ô", "ö", "õ", "ő", "ø", "ơ", "œ", "Ŕ", "Ř", "Ś", "Ŝ", "Š", "Ş", "Ť", "Ţ", "Þ", "Ú", "Ù", "Û", "Ü", "Ŭ", "Ū", "Ů", "Ų", "Ű", "Ư", "Ŵ", "Ý", "Ŷ", "Ÿ", "Ź", "Ż", "Ž", "ŕ", "ř", "ś", "ŝ", "š", "ş", "ß", "ť", "ţ", "þ", "ú", "ù", "û", "ü", "ŭ", "ū", "ů", "ų", "ű", "ư", "ŵ", "ý", "ŷ", "ÿ", "ź", "ż", "ž"); $to = array("A", "A", "A", "AE", "A", "A", "A", "A", "A", "AE", "C", "C", "C", "C", "C", "D", "D", "D", "E", "E", "E", "E", "E", "E", "E", "E", "G", "G", "G", "G", "G", "a", "a", "a", "ae", "ae", "a", "a", "a", "a", "ae", "c", "c", "c", "c", "c", "d", "d", "d", "e", "e", "e", "e", "e", "e", "e", "e", "g", "g", "g", "g", "g", "H", "H", "I", "I", "I", "I", "I", "I", "I", "I", "IJ", "J", "K", "L", "L", "N", "N", "N", "N", "O", "O", "O", "OE", "O", "O", "O", "O", "CE", "h", "h", "i", "i", "i", "i", "i", "i", "i", "i", "ij", "j", "k", "l", "l", "n", "n", "n", "n", "o", "o", "o", "oe", "o", "o", "o", "o", "o", "R", "R", "S", "S", "S", "S", "T", "T", "T", "U", "U", "U", "UE", "U", "U", "U", "U", "U", "U", "W", "Y", "Y", "Y", "Z", "Z", "Z", "r", "r", "s", "s", "s", "s", "ss", "t", "t", "b", "u", "u", "u", "ue", "u", "u", "u", "u", "u", "u", "w", "y", "y", "y", "z", "z", "z"); $from = array_merge($from, $cyrylicFrom); $to = array_merge($to, $cyrylicTo); $newstring = str_replace($from, $to, $string); return $newstring; } function makeSlugs($string, $maxlen = 0) { $newStringTab = array(); $string = strtolower(noDiacritics($string)); if (function_exists('str_split')) { $stringTab = str_split($string); } else { $stringTab = my_str_split($string); } $numbers = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-"); //$numbers=array("0","1","2","3","4","5","6","7","8","9"); foreach ($stringTab as $letter) { if (in_array($letter, range("a", "z")) || in_array($letter, $numbers)) { $newStringTab[] = $letter; } elseif ($letter == " ") { $newStringTab[] = "-"; } } if (count($newStringTab)) { $newString = implode($newStringTab); if ($maxlen > 0) { $newString = substr($newString, 0, $maxlen); } $newString = removeDuplicates('--', '-', $newString); } else { $newString = ''; } return $newString; } function checkSlug($sSlug) { if (preg_match("/^[a-zA-Z0-9]+[a-zA-Z0-9\-]*$/", $sSlug) == 1) { return true; } return false; } function removeDuplicates($sSearch, $sReplace, $sSubject) { $i = 0; do { $sSubject = str_replace($sSearch, $sReplace, $sSubject); $pos = strpos($sSubject, $sSearch); $i++; if ($i > 100) { die('removeDuplicates() loop error'); } } while ($pos !== false); return $sSubject; } $vesti_tag_slug = makeSlugs($string, $maxlen = '0'); /* /. SLUG */ So I want to have tags like: sport | fudbal | cetvrta-liga Can You help how can I get the links that You se above? Thanks in advanced! T
  7. Thank You, its working. I just worry about "admin login", because that have a "timer" for login, and if the cookie is expire in mean time (after submit), than the user must to log in again in Admin pane.
  8. Hi, I have an admin folder where I need to push the scrapping button to do query (scraping some pages). The file for scarping is in root. In the Admin pane have a listing of news and in navbar have a "Scraping button". <!-- bootstrap navbar part --> <li class="nav-item"> <a class="nav-link active border text-yellow-100p" aria-current="page" href="../scraping/index.php">LOAD NEWS</a> </li> So, I want to push the "LOAD NEWS" button and after the scraping query is finished to reload page with news list in same place in Admin. If possible I want a simpliest way to do this... Thanks in adwanced, T
  9. Hi, I want to get a latest video from Youtube Playlist. I look it on Google API, and the other solutions, but I think dont undestand quit good what I need to do. For example a have a playlist: https://www.youtube.com/playlist?list=PLW8l7rX2YaXkaSI8GGbmqPjOEmfzd2hz3 And I want to see always only a latest uploaded video, so I need a link (embed - watch, or "youtu.be/xy"): https://www.youtube.com/watch?v=LyzziLETNUw&list=PLW8l7rX2YaXkaSI8GGbmqPjOEmfzd2hz3 Thanks in advanced, T
  10. The explanation for adding the language is very good and it works, and thak You very much. However, I have trouble leaving .html. Here's how to I use it: index.php?c=vojvodjanski (not vojvodjanski.html) The complete usage is here: (index.php?c=vojvodjanski) RewriteRule ^([^/]*)\.html$ /index.php?c=$1 [L] (index.php?c=vojvodjanski&kategorija=drustvo) RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2 [L] (index.php?c=vojvodjanski&kategorija=drustvo&y=2021&m=03&d=01&vest=gradona-elnik-luka-sa-saradnicima-obi-ao-romska-naselja) RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2&y=$3&m=$4&d=$5&vest=$6 [L] --------------- The first Rule is: https://vojvodjanski.com/vojvodjanski.html The second Rule is: https://vojvodjanski.com/vojvodjanski/drustvo.html The last Rule: https://vojvodjanski.com/vojvodjanski/drustvo/2021/04/08/gradona-elnik-luka-sa-saradnicima-obi-ao-romska-naselja.html --------------- So I want to remove all .html-s like below: The first Rule is: https://vojvodjanski.com/vojvodjanski The second Rule is: https://vojvodjanski.com/vojvodjanski/drustvo The last Rule: https://vojvodjanski.com/vojvodjanski/drustvo/2021/04/08/gradona-elnik-luka-sa-saradnicima-obi-ao-romska-naselja Sorry for a too many questions, but this is the first time that I use the mod_rewrite.
  11. And I have another "problem", I want to remove the .html at end of every rule... I remove the RewriteRule ^([^/]*)\.html$ /index.php?c=$1 [L] but dont work... and I want to remove from all Rules.
  12. /hu/vojvodjanski.html -> /index.php?lg=hu&c=vojvodjanski
  13. What do You mean index.php version? Here is the full htaccess rules: RewriteRule ^([^/]*)\.html$ /index.php?c=$1 [L] RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2&vest=$3 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2&y=$3&m=$4&d=$5&vest=$6 [L] The full (example) link is like: https://vojvodjanski.com/tvbecej/drustvo/2021/04/08/gradona-elnik-luka-sa-saradnicima-obi-ao-romska-naselja.html For (Hungarian) language I will put the "hu", like this: https://vojvodjanski.com/hu/tvbecej/kozjo/2021/04/08/a-polarmester-meglatogatta-a-roma-telepuleseket.html
  14. Hello, I'm pretty weak in mod_rewrite (too), trying to create a bilingual page. The base link looks something like this: 1. http://site.com/vojvodjanski.html htaccess rule: RewriteRule ^([^/]*)\.html$ /index.php?c=$1 [L] 2. http://site.com/vojvodjanski/drustvo.html htaccess rule: RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?c=$1&kategorija=$2 [L] The problem is that I should add an "hu" to each e.g: http://site.com/hu/vojvodjanski.html http://site.com/hu/vojvodjanski/drustvo.html ... I haven't done this with mod rewrite yet, I need help with this, h how to solve it? Thanks in advance, T
  15. At the moment, for some reason, I can't download a single file with this script, but my problem is that I don't know how to solve it by downloading only one file for one file, zipping it for multiple files (with one submitt). I’m not very familiar with PHP programming language, and especially never downloading (plus zipped). I searched the internet for opportunities but couldn’t figure out how to solve it.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.