tschuldigung,
musste plötzlich weg, deshalb erst heute. Hier mal das Template
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<style>
html,body{background:#fff}
.content{color:#ccc;font:14px/1.4 arial,sans-serif;width:900px; height:100px;margin:20px auto}
h1{line-height:1.1;letter-spacing:-1px;}
.layer{ background:#9F0; color:#000; width:50%!important; height:50%!important }
#galleria{ width: 700px; height: 670px; background-image:url(background.png);}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.meineSeite.net/include/includes/galleria/themes/gallery/galleria-1.2.8.min.js"></script>
<script src="http://www.meineSeite.net/include/includes/galleria/plugins/history/galleria.history.min.js"></script>
<div id="galleria">
{EXPLODE}<form><input type="hidden" />{pos}</form><img class="agree" src="include/images/gallery/img_thumb_{id}.{endung}" rel="include/images/gallery/img_{id}.{endung}" name="{pos}" meid="{pos}" id="{pos}" align="middle" border="0" />{EXPLODE}
</div>
<script>
$('input:hidden').change(function(){
var text = $(this).val();
$.get('http://meineSeite.de/include/contents/media_view_show.php', {
get_text: hidden
},function(data){
alert(data);
});
});
var full_url = document.URL; // Get current url
var url_array = full_url.split('#/') // Split the string into an array with / as separator
var last_segment = url_array[url_array.length-1]; // Get the last part of the array (-1)
var last_segment1 = url_array[url_array.length-2];
// alert( last_segment ); // Alert last segment
// Load the classic theme
Galleria.loadTheme("http://www.meineSeite.net/include/includes/galleria/themes/gallery/galleria.classic.js");
// Initialize Galleria
$('#galleria').galleria({
autoplay: false,
lightbox: false,
delay: 0,
layer: true,
trueFullscreen: false,
clicknext: false,
show: last_segment,
});
//--->FACEBOOK
Galleria.run('#galleria');
Galleria.on('image', function() {
$('#galleria').click(function() {
var intfull = document.URL;
var imageid_array = intfull.split('#/') ;
last_seget = imageid_array[imageid_array.length-1];
name = last_seget;
$.ajax({
type: 'POST',
url: "http://meineSeite.de/include/contents/media_view_show.php",
async: false,
data:{idid:last_seget},
success: function(data){
},
});
});
});
Galleria.on('image', function() {
$('#galleria').click(function() {
intfull = document.URL;
var imageid_array = intfull.split('#/') ;
last_sege = imageid_array[imageid_array.length-1];
alert(last_sege);
return false;
});
});
Galleria.on('image', function() {
intfull = document.URL;
var imageid_array = intfull.split('#/') ;
last_seg = imageid_array[imageid_array.length-1];
});
var iframe = function(last_seg) {
var url = last_segment1 +'#/'+ last_seg;
var rurl = url;
return '<div class="fb-like" data-href="'+url+'" data-width="450" data-show-faces="true" data-send="false"></div>';
}
Galleria.on('data', function() {
var self = this;
$.each( self._data, function(i) {
self._data[i].layer = iframe(i);
});
});
Galleria.ready(function(){
this.bind('image', function(e) {
FB.XFBML.parse();
});
});
Galleria.on('thumbnail',function(e){
$(e.thumbTarget).parent().append('<span style ="color:#fff;">'+(e.index+1)+'</span>');
});
//<-----FACEBOOK
$('<a>').click(function(e) {
e.preventDefault();
gallery.toggleFullscreen(); // sets the gallery in fullscreen
}).html("<img src='http://www.meineSeite.net/include/includes/galleria/themes/gallery/pauseplay.jpg' height='20' width='20' alt='#' />").appendTo('#full');
Galleria.ready(function(){
var gallery = this;
var toggler = $('<a>',{
'href': '#',
'text': '',
'class': 'toggler',
'click': function(e) {
e.preventDefault();
gallery.toggleFullscreen();
}
}).prependTo('.galleria-stage');;
this.bind('fullscreen_enter', function() {
toggler.addClass('fullscreen').text('');
}).bind('fullscreen_exit', function() {
toggler.removeClass('fullscreen').text('');
});
Galleria.addTransition("reversePulse", function(params, complete) {
if (params.prev) {
$(params.next).hide();
$(params.prev).css("opacity",1).show();
Galleria.utils.animate(params.prev, {
opacity: 0
},{
duration: params.speed,
complete: function() {
$(params.next).show();
complete();
}
});
}
});
Galleria.ready(function() {
var gallery = this;
this.addElement('play');
this.appendChild('stage','play');
var btn = this.$('play')
.css('color', 'white')
.text('PAUSE')
.click(function() {
gallery.playToggle();
});
this.bind('play', function() {
btn.text('PLAY');
btn.addClass('playing');
}).bind('pause', function() {
btn.removeClass('playing');
});
this.addIdleState(this.get('play'), { opacity:0 });
});
Galleria.configure({
transition: "fade",
transitionSpeed: 0,
});
});
</script>
und in der media-view-show.php versuch ich das hier abzufragen.
$idid = $_POST['idid'];
$end = @db_result(db_query("SELECT endung FROM prefix_gallery_imgs WHERE pos = '".$idid."' AND cat = '".$cid."'"),0);
$ame = @db_result(db_query("SELECT name FROM prefix_gallery_cats WHERE id = '".$cid."'"),0);
$imid = @db_result(db_query("SELECT id FROM prefix_gallery_imgs WHERE pos = '".$idid."' AND cat = '".$cid."'"),0);
$title = $allgAr['title'].' :: Media '.$cattitle;
$hmenu = '<a class="smalfont" href="?media">Media</a>'.$catname;
$design = new design ( $title , $hmenu );
$design->addheader('<style type="text/css"></style><meta property="og:image" content="http://www.headis.de/include/images/gallery/img_'.$imid.'.'.$end.'"><meta property="og:url" content="http://www.headis.de/index.php?media_view_show-'.$cid.'#/'.$idid.'" /><meta property="og:type" content="article" /><meta property="og:title" content="'.$ame.'" />');
$design->header();
$tpl = new tpl ('media_view_show' );
$erg = db_query("SELECT id,name ,cat FROM prefix_gallery_cats WHERE recht >= {$_SESSION['authright']} AND cat = ".$cid." ORDER BY pos");
if ( db_num_rows($erg) > 0 ) {
while ($row = db_fetch_assoc($erg) ) {
$rang = escape($menu->get(3), 'integer');
$row['cname'] = $row['name'];
$row['gallery'] = count_files($row['id']);
$class = ( $class == 'Cnorm' ? 'Cnorm' : 'Cnorm' );
$row['class'] = $class;
$tpl->set_ar_out($row,1);
$limit = $img_per_site;
$page = ($menu->getA(2) == 'p' ? escape($menu->getE(2), 'integer') : 1 );
$anfang = ($page - 1) * $limit;
$erg1 = db_query("SELECT prefix_gallery_imgs.id, prefix_gallery_imgs.pos, prefix_gallery_imgs.cat, prefix_gallery_imgs.datei_name, prefix_gallery_imgs.endung, prefix_gallery_imgs.`besch`, klicks,vote_wertung, vote_klicks FROM prefix_gallery_imgs LEFT JOIN prefix_gallery_cats ON prefix_gallery_imgs.cat = prefix_gallery_cats.id WHERE prefix_gallery_imgs.cat = '".$row['id']."' AND (recht >= ".$_SESSION['authright']." OR recht IS NULL) ORDER BY id ASC LIMIT ".$anfang.",".$limit);
if ( db_num_rows($erg1) > 0 ) {
$tpl->set('imgperline', $allgAr['gallery_imgs_per_line']);
$tpl->set('cname', $cname);
$tpl->set('breite', $allgAr['gallery_normal_width']+30);
$tpl->out(2); $class = 'Cnorm';
$i = 0;
while($row1 = db_fetch_assoc($erg1) ) {
$row1['class'] = $class;
$row1['width'] = round( 100 / $img_per_line );
$row1['bildr'] = $i + (($page-1) * $img_per_site);
if ( $i <> 0 AND ($i % $img_per_line ) == 0 ) { echo '</tr><tr>'; }
$i++;
$tpl->set_ar_out($row1,3);
}
if ( $i % $img_per_line <> 0 ) {
$anzahl = $img_per_line - ($i % $img_per_line);
for($x=1;$x<=$anzahl;$x++){
echo '<td class="'.$class.'"></td>';
}
}
}
$tpl->out(4);
}
}
der code ist noch nicht ganz aufgeräumt ;-)
Die Faceboook API habe ich mir nochmal angeschaut, aber icht das gefunden was ich brauch. Bei den News war es ähnlich, auf der Übersichts Seite der News, habe ich eine Funktion damals gebaut, die für jeden NewsPost die Bild ID abfragt und dann an Facebook über open graphs weitergibt. Da bekomme ich jetzt auch immer das Bild das zu der News passt, aber hier wills nicht klappen.
Der Firebug zeigt als Anwort immer no direct access und als POST idid = 9, scheint so als das der POST erst gar nicht übermittelt wird, weil die php bockt. Wie kann man das beheben??
danke
samo
Zuletzt modifiziert von samo am 08.09.2013 - 11:25:04
Ain't no use running, fool! I know where your mama parks your house