Jump to content
Fórum Script Brasil
  • 0

Rede social


arldin

Question

Boa tarde amigos estou montando uma rede social tipo o face

to precisando de uma ajuda na questão do comentario nas fotos

tenho as paginas

uma e a

photolist.php

<?php
    ('auth.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE><LINK 
rel=icon type=image href="img/Untitled-1.png"><LINK rel="shortcut icon" 
type=image href="img/Untitled-1.png">
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=keywords content="">
<META name=description content=""><LINK rel=stylesheet type=text/css 
href="format.css">
<STYLE type=text/css>

.style1 {font-weight: bold}
.style2 {font-size: 12px}
.style3 {color: #0000FF}
-->
</STYLE>
<style type="text/css">
<!--
body {
    background-image: url(images/New%20Picture.jpg);
    background-repeat: repeat-x;
}
.style1 {font-weight: bold}
-->
</style>

&lt;script type=text/javascript>
<!--
var timeout         = 500;
var closetimer        = 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{    
    // cancel close timer
    mcancelclosetime();

    // close old layer
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
    closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
    if(closetimer)
    {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

// close layer when click-out
document.onclick = mclose; 
// -->
</SCRIPT>

<META name=GENERATOR content="MSHTML 9.00.8112.16455"></HEAD>
<BODY>
<DIV></DIV>
<DIV style="CLEAR: both"></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV class=left>
<DIV class="link style1">
<UL id=sddm1>
  <DIV style="CLEAR: both"></DIV></UL></DIV>
<DIV align=center></DIV></STRONG><BR></DIV></DIV>
<DIV class=rightleft>AAAAAAAAA 
<DIV class=EDUC><STRONG>Suas fotos</STRONG></DIV>
<DIV class=photoslist><?php
$con = mysql_connect("127.0.0.1", "usuario do db", "senha");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("bookfest_bookface", $con);

$result = mysql_query("SELECT * FROM photos WHERE uploadedby='".$_SESSION['SESS_MEMBER_ID'] ."'  ORDER BY photo_id DESC");


while($row = mysql_fetch_array($result))
  {

  //echo "<img width=100 height=100 alt='Unable to View' src='" . $row["location"] . "'>";

 echo '<a href=photocomment.php?id=' . $row["photo_id"] . '>' . "<img width=100 height=100 alt='Unable to View' src='". $row["location"] . "'>" . '</a>';

  echo"     ";

  }

mysql_close($con);
?></DIV>BBBBBBBBBB </DIV>
<DIV></DIV>
<DIV></DIV></BODY></HTML>
e a outra que e photocomment.php
<?php
    require_once('auth.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" href="img/Untitled-1.png" type="image" />
<link rel="shortcut icon" href="img/Untitled-1.png" type="image" />

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="">
    <meta name="description" content="">
<title>Untitled Document</title>
<link href="format.css" rel="stylesheet" type="text/css" />
<style type="text/css">

</style>

&lt;script type="text/javascript">
<!--
var timeout         = 500;
var closetimer        = 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{    
    // cancel close timer
    mcancelclosetime();

    // close old layer
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible';
    

}
// close showed layer
function mclose()
{
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
    closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
    if(closetimer)
    {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

// close layer when click-out
document.onclick = mclose; 
// -->
</script>
</head>

<body>

<div class="main">


  
  <div class="lefttoright">
  <?php
    $con = mysql_connect('localhost','usuario do db',"senha");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("bookfest_bookface", $con);

$result = mysql_query("SELECT * FROM friendlist WHERE firstname='".$_SESSION['SESS_FIRST_NAME'] ."' and status='pending' ORDER BY firstname ASC");
    
    $numberOfRows = MYSQL_NUMROWS($result);    
    
    echo '<font size="2" color="red"><b></b></font>'; 
    ?>
        
        
        <?php
    $con = mysql_connect('localhost','usuario do db',"senha");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("bookfest_bookface", $con);

$result = mysql_query("SELECT * FROM messages WHERE receiver='".$_SESSION['SESS_FIRST_NAME'] ."' and status='pending' ORDER BY receiver ASC");
    
    $numberOfRows = MYSQL_NUMROWS($result);    
    echo '<font size="2" color="red"><b></b></font>';
    ?>
  </div>
</div>
    
    
    
  <div class="righttop">
  


<div style="clear:both"></div></div>
  </div>
  <div class="left">

    
    
  </div>
  <div class="right1">
    <div class="rightleft">
      <div class="name"><strong><?php
$con = mysql_connect("127.0.0.1", "usuario do db", "senha");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("bookfest_bookface", $con);

$result = mysql_query("SELECT * FROM members WHERE member_id='".$_SESSION['SESS_MEMBER_ID'] ."'");

while($row = mysql_fetch_array($result))
  {
  
  echo "<h3>".$row['FirstName']." ".$row['LastName'].">Photos"."</h3>";
  

          //echo "<img width=50 height=50 alt='Unable to View' src='" . $row["location"] . "'>";
          //echo '<a href=member-index.php?id=' . $row["friends_id"] . '>' . $row['firstname'] . '</a><br />';
        
  }

mysql_close($con);
?></strong></div>

<form action="savecomment.php" method="get">

      <div class="photocommentlist">
      
      <?php
    if (isset($_GET['id']))
    {
$con = mysql_connect('localhost','usuario do db',"senha");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("bookfest_bookface", $con);

$member_id = $_GET['id'];

//echo "SELECT * FROM members WHERE member_id = $member_id";
$result = mysql_query("SELECT * FROM photos WHERE photo_id = $member_id");

$row = mysql_fetch_array($result);
if (!$result) 
                        {
                        echo "wala";
                        }
                        else{
echo "<br />";
echo "<img width=200 height=200 alt='Unable to View' src='" . $row["location"] . "'> <br />";
  echo'<input type="hidden" name="useid" value="'. $row["photo_id"] .'"."<br>';

mysql_close($con);
}
}
?>
      
      </div>
      
      
      
      <div class="commentphoto">
      
        <div class="commentphoto2">
        
        <?php
        if (isset($_GET['id']))
    {
$con = mysql_connect("localhost","usuario do db","senha");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("bookfest_bookface", $con);
$member_id = $_GET['id'];

$query  = "SELECT * FROM photoscomment WHERE commentby='$member_id' ORDER BY comment_id DESC";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
echo '<div class="white">';
   echo '<font color="Blue">';
   echo '<b>';
   echo '<div class="style1">';
   echo $_SESSION['SESS_FIRST_NAME'];
   
   echo '</b>';
   echo '</font>';
   echo '  ';
    //echo'<input type="text" name="firstname" value="'. $row['messages_id'] .'">'; 
    echo '<font size="4px">';
    echo "{$row['comment']}<br>";
    echo '</font>';
    
echo '</div>';
echo '</div>';
} 

if (!mysql_query($query,$con))
  {
  die('Error: ' . mysql_error());
  }

}
mysql_close($con)

?>
        
        
        </div>
        
      </div>
      <div class="commentphoto1">
        <input type="text" name="textfield" value="-Deixe comentário aqui-" onclick="this.value='';" />
        <input type="hidden" name="textfield1" value="<?php echo $_SESSION['SESS_LAST_NAME'];?>" />
        <input type="submit" name="Submit" value="Submit" />
       
      </div></form>
    </div>
    </div>
    
</div>
</body>
</html>

Ate aqui beleza quando clica na imagem que vem do db a pagina photocomment.php abre para fazer o comentario

mais o que eu estou querendo e que ao clicar na imagem selecionada a pagina abre dentro de um div

já tentei com o ajax.js mais ai ela abre mais não seleciona a o id da foto

Como posso resolver isto

se caso quiserem da uma olhada o linke erede_social

como eu tirei a parte de inscrição vocês podem ver acesando com o usuario 123 e senha 123

Desde já agradeço a todos

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Acho que você quer um popup, correto?

A imagem abra na mesma janela, onde o usuario possa clicar para fechar.

Isso se trata de javascript/ajax.

Dê uma estudada no jQuery. Vai mudar sua vida.

E então esse plugin para o jquery (que é o que abre as imagens. No caso você vai carregar no popup a página de comentario... não só a iamgem):

http://www.jacklmoore.com/colorbox

Link to comment
Share on other sites

  • 0

Não vejo motivo pra não dar certo.

o colorbox se enquadra em suas necessidades.

ele pode carregar apenas imagens (basta você escrever 1 linha de javascript), ou páginas em popups.

E mais, não há como fazer sem utilizar javascript.

Estude-o. Poste seu teste aqui para verificar.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...