Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Yourls
Forum PHP.pl > Forum > Przedszkole
rafauonline
Mam pytanie: w jaki sposób zmienić kod, żeby tworzone linki nie były generowane po kolei (tj. http://sho.rt/1, 2, 3, (...), a, b, c etc.) tylko tak jak w serwisie bit.ly czyli np. http://sho.rt/fv5gcJ, http://sho.rt/e1YGkV itp. (z użyciem małych i dużych liter oraz cyfr)?
W pliku config.php ustawiłem:
define( 'YOURLS_UNIQUE_URLS', false ); oraz
define( 'YOURLS_URL_CONVERT', 62 ); jednak nic to nie dało.

Skrypt dostępny jest pod adresem: http://yourls.org
nekomata
Wątpię by komuś chciało się specjalnie ściągać cały skrypt , instalować a potem zobaczyć co Ci nie działa i jak to zmienić, poszukaj części która jest odpowiedzialna za tworzenie URL i nam podrzuć .
rafauonline
Prawdopodobnie chodzi tu o dwa pliki:

config.php
  1. <?php
  2. /* This is a sample config file.
  3.  * Edit this file with your own settings and save it as "config.php"
  4.  * You can leave it in the "includes" directory, or, better, move it to
  5.  * the "user" directory. This way, when a new version of YOURLS is available,
  6.  * simply delete everything but "/user", and upload the new version.
  7.  */
  8.  
  9.  
  10. /*
  11.  ** MySQL settings - You can get this info from your web host
  12.  */
  13.  
  14. /** MySQL database username */
  15. define( 'YOURLS_DB_USER', 'dbuser' );
  16.  
  17. /** MySQL database password */
  18. define( 'YOURLS_DB_PASS', 'dbpassword' );
  19.  
  20. /** The name of the database for YOURLS */
  21. define( 'YOURLS_DB_NAME', 'yourls' );
  22.  
  23. /** MySQL hostname */
  24. define( 'YOURLS_DB_HOST', 'localhost' );
  25.  
  26. /** MySQL tables prefix */
  27. define( 'YOURLS_DB_PREFIX', 'yourls_' );
  28.  
  29. /*
  30.  ** Site options
  31.  */
  32.  
  33. /** YOURLS installation URL, no trailing slash */
  34. define( 'YOURLS_SITE', 'http://site.com' );
  35.  
  36. /** Timezone GMT offset */
  37. define( 'YOURLS_HOURS_OFFSET', 0 );
  38.  
  39. /** Allow multiple short URLs for a same long URL
  40.  ** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
  41.  ** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */
  42. define( 'YOURLS_UNIQUE_URLS', false );
  43.  
  44. /** Private means protected with login/pass as defined below. Set to false for public usage. */
  45. define( 'YOURLS_PRIVATE', true );
  46.  
  47. /** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/
  48. define( 'YOURLS_COOKIEKEY', 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm' );
  49.  
  50. /** Username(s) and password(s) allowed to access the site */
  51. $yourls_user_passwords = array(
  52. 'username' => 'password',
  53. 'username2' => 'password2' // You can have one or more 'login'=>'password' lines
  54. );
  55.  
  56. /*
  57.  ** URL Shortening settings
  58.  */
  59.  
  60. /** URL shortening method: 36 or 62 */
  61. define( 'YOURLS_URL_CONVERT', 62 );
  62. /*
  63.  * 36: generates case insentitive lowercase keywords (ie: 13jkm)
  64.  * 62: generate case sensitive keywords (ie: 13jKm or 13JKm)
  65.  * Stick to one setting, don't change after you've created links as it will change all your short URLs!
  66.  * Base 36 should be picked. Use 62 only if you understand what it implies.
  67.  */
  68.  
  69. /**
  70. * Reserved keywords (so that generated URLs won't match them)
  71. * Define here negative, unwanted or potentially misleading keywords.
  72. */
  73. $yourls_reserved_URL = array(
  74. 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay',
  75. );
  76.  
  77. /*
  78.  ** Personal settings would go after here.
  79.  */


i functions.php
http://www63.zippyshare.com/v/95458830/file.html

Wielkie dzięki za pomoc, jesteście kurwa zajebiści. Sam sobie poradzę. Do widzenia.
nospor
Cytat
Wielkie dzięki za pomoc, jesteście kurwa zajebiści.
Się wie smile.gif Idź idź i nie wracaj
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.