嗨,我有一个消息提示框,当用户收到新消息时出现,我想要做的是当它弹出时添加声音到这个框,我使用PHP if语句检查用户何时获得新消息和我尝试通过以下操作添加声音,但它不起作用请有人告诉我如何做到这一点.谢谢.
<?php
$check_new_chats = check_new_chats();
while ($chat = mysql_fetch_array($check_new_chats))
if (isset($_SESSION['user_id'])) {
if ($chat['to_user_id'] == $_SESSION['user_id']){
echo( "<embed name='sound_file' src='/assets/music/sound_file.mp3' loop='true' hidden='true' autostart='true'/>"); ?>
Run Code Online (Sandbox Code Playgroud) 我有一个textarea框,回声'生物' - '生物'是我的数据库中的文本内容.
我在这个文本区域旁边还有一个css框,想知道如何将文本限制为三行,然后在CSS框下面继续.
这是一个图表:
_ _ _ _ _ _ _ _ _ _
| | Bio Content Goes Here
| | blah, blah, blah, blah
- - - - - - - - - - blah, blah, blah, blah
Content carrys on here, here, here and here etc.
Content carrys on here, here, here and here etc.
Run Code Online (Sandbox Code Playgroud) 我想在我的javascript中添加一个else语句,目前如果用户点击链接然后div隐藏,但我想要它,以便如果他们再次点击链接,div将取消隐藏.有人可以告诉我如何做到这一点谢谢?
<a id="myLink" href="javascript:void(0)" onclick="javascript:myLinkButtonClick();"><h3 id="bobcontent1-title" class="handcursor"><img src="assets/img/help_support/howdo.png" width="302" height="45" /></a>
<script>
function myLinkButtonClick()
{
$(".nswp-frame2").hide();
}
</script>
Run Code Online (Sandbox Code Playgroud) 我有一个名为ptb_profile_views的表;
id | profile_id | viewed_profile | date
1 1 5
2 1 5
3 1 5
4 2 5
5 3 5
Run Code Online (Sandbox Code Playgroud)
好的,所以在这个例子中,用户1,2 ans 3正在检查用户5的个人资料,
我在这里的mysql假设要计算用户的查看次数,但是用户1多次检出用户5我不想返回重复的行,
因此,不是说用户5被观看了5次,而是实际上只被观看了3次,因为我只想计算不同的值.
继承人我的mysql有人可以帮助我:
function check_profile_views() {
global $connection;
global $_SESSION;
$query = "SELECT COUNT(profile_id) FROM ptb_profile_views WHERE viewed_profile_id=".$_SESSION['user_id']." AND profile_id!='0'";
$check_profile_views_set = mysql_query($query, $connection);
confirm_query($check_profile_views_set);
return $check_profile_views_set;
}
Run Code Online (Sandbox Code Playgroud)
php:
$check_profile_views_set = check_profile_views();
while ($views = mysql_fetch_array($check_profile_views_set)) {
?>
<? echo"". $views['COUNT(profile_id)'] ."";?> viewed your profile
Run Code Online (Sandbox Code Playgroud) 我试图找到一种方法,允许我的网站上的用户删除文件夹中的某些图像 'photo/image id' = $_SESSION['user_id']
有没有我可以用来做这个的脚本?如果有人能告诉我我需要做什么或者指出我正确的方向,我真的很感激.
我在寻找的东西,其中的照片会被echo'ed出来,旁边的照片将是一个删除按钮或类似的东西,用户可以依次对每张照片,将它从一个文件夹中删除其中的图像文件夹directory = the $_session['user_id'],并在那里那个photo = the photo id什么的.