Reputation: 11
Sorry for my english language which is not very good.
I try to link my chevereto images on a homepage of my principal website.
I can rebuilt the image url with the sql when i now the id.
But i want to link to the image page with the infos, embed codes, etc.
The link is like this:
https://www.example.com/chevereto/image/acbR
acbR is not in the database Sql. I think it's a string built with a phpscript.
On the code of the script Chevereto i found this fonction:
function chevereto_id($var) {
$base_chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // DON'T REPEAT A SINGLE CHAR!
for ($n = 0; $n<strlen($base_chars); $n++) {
$i[] = substr( $base_chars,$n ,1);
}
$passhash = hash('sha256', 'c70a053b');
$passhash = (strlen($passhash) < strlen($base_chars)) ? hash('sha512', 'c70a053b') : $passhash;
for ($n=0; $n < strlen($base_chars); $n++) {
$p[] = substr($passhash, $n ,1);
}
array_multisort($p, SORT_DESC, $i);
$base_chars = implode($i);
$string = '';
$len = strlen($base_chars);
while($var >= $len) {
$mod = bcmod($var, $len);
$var = bcdiv($var, $len);
$string = $base_chars[$mod].$string;
}
return $base_chars[$var] . $string;
}
With id number 84 i have to find acbR
but it dont works.
If someone know chevereto script and want to help me, i will be very happy!
Upvotes: 1
Views: 498
Reputation: 43
Chevereto uses encoded IDs to reference the actual table IDs. Here, check the source.
You need to use this:
CHV\decodeID($encoded_id);
(which was just below the code you entered).
Upvotes: 2