forked from declanmaher/InstagramScraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
104 lines (83 loc) · 2.74 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<html>
<head>
<meta charset="utf-8" />
<title>Instagram Approval App</title>
<?php
require 'errorandExceptionHandlers.php';
?>
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#more').click(function() {
var tag = $(this).data('tag'),
maxid = $(this).data('maxid'); //console.log(maxid);
$.ajax({
type: 'GET',
url: 'ajax.php',
data: {
tag: tag,
max_id: maxid
},
dataType: 'json',
cache: false,
success: function(data) {
// Output data
$.each(data.images, function(i, src) {
$('ul#photos').append('<li><img src="' + src + '"></li>');
});
// Store new maxid
$('#more').data('maxid', data.next_id);
}
});
});
// if no images selected then don't allow form submit
$("form:first").submit(function(){
if(document.getElementById("savedImages").value == '')
{
alert('Please select at least one image before saving.');
return false; }
});
// set array for photos approved
var allVals = [];
// This function saves the images clicked by user -to a textarea
$('#photos').on( "click","img", function() {
allVals.push($(this).attr('src'));
$(this).css("border","2px solid red");
$(this).css('margin', '-2px');
$('#savedImages').val(allVals)
});
// reset all the image borders
$(document).on("click", "input[type='reset']", function(){
$("#photos img").each(function (i) {
$(this).css("border","2px solid white");
$(this).css('margin', '-2px');
});
});
// toggle the help info
$( "#help" ).click(function() {
$( "p" ).slideToggle( "slow" );
});
});
</script>
</head>
<body>
<div id="header-container">
<div id="header">
<div id="header2">
<div id="navigation">
<h2 >
Instagram Approval App
</h2>
<?php // don't show on login page
if(basename($_SERVER['PHP_SELF']) != 'index.php' ) { ?>
<ul>
<li id="home-nav"><a href="home.php">Approve Images</a></li>
<li id="about-nav"><a href="viewImages.php">View Approved Images</a></li>
<li id="news-nav"><a href='home.php?id=logout'>Logout of App</a></li>
</ul>
<?php } ?>
</div>
</div>
</div>
</div>