예제 #1
0
function conv_tag($mystring)
{
    // used variables
    $search = "/\\[mygal=([A-Za-z0-9\\-\\_]+)(|\\([0-9\\,]+\\))\\]/";
    $mg_options = get_option('mygalleryoptions');
    global $myurl;
    if (preg_match($search, $mystring)) {
        preg_match_all($search, $mystring, $temp_array);
        if (is_array($temp_array[1])) {
            foreach ($temp_array[1] as $key => $v0) {
                $search = "/\\[mygal=" . $v0 . addcslashes($temp_array[2][$key], '\\(\\)') . "\\]/";
                $replace = showtumbs($v0, 0, $temp_array[2][$key]);
                $mystring = preg_replace($search, $replace, $mystring);
            }
        }
    }
    $search = "/\\[mygallistgal\\]/";
    if (preg_match($search, $mystring)) {
        if (preg_match($search, $mystring)) {
            $replace = gallistgal();
            $search = "/\\[mygallistgal\\]/";
            $mystring = preg_replace($search, $replace, $mystring);
        }
    }
    $search = "/\\[myginpage=(\\w+)\\]/";
    if (preg_match($search, $mystring)) {
        preg_match_all($search, $mystring, $temp_array);
        if (is_array($temp_array[1])) {
            foreach ($temp_array[1] as $v0) {
                $search = "/\\[myginpage=" . $v0 . "\\]/";
                $replace = showtumbs($v0, 1);
                $mystring = preg_replace($search, $replace, $mystring);
            }
        }
    }
    $search = "/\\[inspic=(\\d+)(|,\\w+|,)(|,http:\\/\\/[^,]+|,fullscreen|,gal|,)(|,thumb|,\\d+|,)(|,:\\w+)\\]/";
    if (preg_match($search, $mystring, $sresult)) {
        preg_match_all($search, $mystring, $temp_array);
        if (is_array($temp_array)) {
            foreach ($temp_array[1] as $key => $v0) {
                $search = "/\\[inspic=" . $v0 . $temp_array[2][$key] . addcslashes($temp_array[3][$key], '\\/') . $temp_array[4][$key] . $temp_array[5][$key] . "\\]/";
                $replace = myinlinepicture($v0, $temp_array[2][$key], $temp_array[3][$key], $temp_array[4][$key], $temp_array[5][$key]);
                $mystring = preg_replace($search, $replace, $mystring);
            }
        }
    }
    $search = "/\\[mypicref=(\\d+)\\](.*)\\[\\/mypicref\\]/U";
    if (preg_match($search, $mystring)) {
        preg_match_all($search, $mystring, $temp_array);
        if (is_array($temp_array[1])) {
            foreach ($temp_array[1] as $key => $v0) {
                $search = "/\\[mypicref=" . $v0 . "\\](.*)\\[\\/mypicref\\]/U";
                $replace = mytextpiclink($v0, $temp_array[2][$key]);
                $mystring = preg_replace($search, $replace, $mystring);
            }
        }
    }
    $mystring = " \t" . $mystring;
    return $mystring;
}
예제 #2
0
function myshowgallerys($somegallerynames = 0)
{
    global $mg_options;
    if ($_GET['gallery']) {
        echo showtumbs($_GET['gallery']);
    } else {
        if ($_GET['picture_id']) {
            $result = getpicture($_GET['picture_id']);
            if ($result) {
                $mygalleryid = getgalleryidformpictureid($_GET['picture_id']);
                $mygalleryname = getgalleryname($mygalleryid);
                $myreference = gallery_reference(0, $mygalleryname);
                echo createhtmlforbigpicture($result, $_GET['picture_id'], $myreference);
                if ($mg_options[bigpicshowthumbs]) {
                    echo showtumbs($mygalleryname);
                }
            }
        } else {
            echo gallistgal($somegallerynames);
        }
    }
}