SitePoint Sponsor |
|
User Tag List
Results 1 to 14 of 14
Thread: Message not displaying?
-
Dec 11, 2006, 14:07 #1
Message not displaying?
Hi, after a member posted a comment, the below code is supposed to display "Your comment has been successfully posted etc" but it doesn't for some reason. Do you have any idea where should I look for the error, I compared this .tpl file with the original one from the seller and there's nothing that's not the same.
PHP Code:{if $smarty.session.UID ne "" and $isvideocommented ne ""}
<DIV ID=divComments>
<FORM name="Add_comment" method="post" action="{$baseurl}/view_video.php?viewkey={$smarty.request.viewkey}&page={$smarty.request.page}&viewtype={$smarty.request.viewtype}&category={$smarty.request.category}">
<DIV id=div_main_comment style="PADDING-left: 10px">
<textarea name=addcomment ID=txtComments rows=5 cols=30></textarea>
<br>
<input type="button" name="commentpost" value="Post Comment" onClick=fxSendComments('divComments','txtComments',{$smarty.session.UID},{$VID})>
</DIV>
</FORM>
</DIV >
<DIV ID=divComResult1 style='display:none'>
<B><FONT COLOR=#339900>Your Comments has posted successfully.</FONT></B>
</DIV>
<DIV ID=divComResult2 style='display:none'>
<B><FONT COLOR=#FF0033>Your already posted you comments.</FONT></B>
</DIV>
{/if}
-
Dec 11, 2006, 14:19 #2
I replaced the file with the original file and it's still not displaying, can anyone help me please?
-
Dec 11, 2006, 14:24 #3
- Join Date
- Mar 2005
- Location
- Ukraine
- Posts
- 1,403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Add an else statement:
Code:{if $smarty.session.UID ne "" and $isvideocommented ne ""} ..... {else} Session id: {$smarty.session.UID}<br /> Is video commented: {$isvideocommented}<br /> {/if}
-
Dec 11, 2006, 14:34 #4
If statement is to check if the visitor is a guest. If he/she is a guest, that comment will ask him to log in.
-
Dec 11, 2006, 14:36 #5
I added the code you gave and received a fatal error.
-
Dec 11, 2006, 14:37 #6
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
your problem
I REALLY dont like that way of coding (prefer REAL php), but this is your problem:
Code:style='display:none'
PHP Code:style='display:<?
if(!isset($isvideocommented)){
echo "none";
}else{
echo "block";
}?>'Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Dec 11, 2006, 14:39 #7
Doesn't work, like I said, I replaced the whole .tpl code with the one from the seller and it still doesn't work, it's supposed to work, can you explain to me how the div tags work? I think I can explore the error and fix it.
-
Dec 11, 2006, 14:40 #8
-
Dec 11, 2006, 15:36 #9
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
yep. What is this code used for? Unless it's a kind of PHPBB application, i would suggest learning PHP.
My favorite tutorial site is w3schools. They taught me everything i needed to know for amateur PHPing, and the rest you learn from here!Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Dec 11, 2006, 15:39 #10
It's not phpBB, it's a video sharing site like youtube. This is the comment feature.
BTW, I replaced the code, but it doesn't seem to work, I hope you know how smarty template works.
-
Dec 11, 2006, 17:27 #11
- Join Date
- Mar 2005
- Location
- Ukraine
- Posts
- 1,403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Dec 11, 2006, 19:05 #12
No, not that, the problem is, it's not displaying the "Your comment was successfully posted" message when someone successfully posted.
-
Dec 11, 2006, 23:42 #13
- Join Date
- Mar 2005
- Location
- Ukraine
- Posts
- 1,403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Probably this is what you're looking for:
Code:{if $smarty.session.UID ne ""} <DIV ID=divComments> <FORM name="Add_comment" method="post" action="{$baseurl}/view_video.php?viewkey={$smarty.request.viewkey}&page={$smarty.request.page}&viewtype={$smarty.request.viewtype}&category={$smarty.request.category}"> <DIV id=div_main_comment style="PADDING-left: 10px"> <textarea name=addcomment ID=txtComments rows=5 cols=30></textarea> <br> <input type="button" name="commentpost" value="Post Comment" onClick=fxSendComments('divComments','txtComments',{$smarty.session.UID},{$VID})> </DIV> </FORM> </DIV > {if $isvideocommented ne ""} <DIV ID=divComResult1 style='display:none'> <B><FONT COLOR=#339900>Your Comments has posted successfully.</FONT></B> </DIV> {else} <DIV ID=divComResult2 style='display:none'> <B><FONT COLOR=#FF0033>Your already posted you comments.</FONT></B> </DIV> {/if} {/if}
-
Dec 12, 2006, 00:28 #14
I don't think you understand, the code's supposed to work fine, the problem is supposed to be besides the code. As I've mentioned, I replaced the .tpl file (this file) with the working version but it still isn't working. Thanks for the effort anyway.
Let me know if you/anyone know something else, like maybe it's the function.php etc
Bookmarks