MyBB Community Forums

Full Version: MyVids Beta 1 (Silver) release
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10
I tried it on a fresh install (well, the 1.6.3 files), and nothing changed. By the rest of the JS what do you mean, the only thing it really works for is adding comments that I've tried.

Edit:

Another small issue, when using the search the table head says "Latest Videos".
Adding comments and comment pagnation. I'm just upgrading my local board to 1.6.3 (it was on 1.6.2) and trying a fresh install too to check results.
Oh, 1.6.3 had some updates to Prototype so that could be the issue.

Edit:

Pagination works, although I do have to refresh after I add enough so it goes to the second page. Also, as a suggestion, have the date the comment was posted shown and add some flood protection since it can be spammed quite easily currently.
It could be. My localhost is having a different issue with the viewvid.php file though although it worked before haha
Ah-ha! Found the problem! I missed a } in myvids_watch. Replace that template with this and see if it helps:

{$headerinclude}
    <title>{$lang->myvids_watching_vid} "{$vidtitle}" - {$mybb->settings['bbname']}</title>
    <script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery.min.js"></script> 
	
	<script type="text/javascript">
	jQuery.noConflict();
	jQuery(document).ready(function($) {

		var pages = $(".pagination_page");

		pages.click(function() {

			var pageNum = this.id;
			var targetUrl = "videocomments.php?vid={$vid}&page=" + pageNum;

			$(".pagination_current").removeClass("pagination_current");
			$(this).addClass("pagination_current");

			$.get(targetUrl, function(data) {
				$(".maincommentlist").html(data);
			});

			var destination = $(".maincommentlist").offset().top;
			$("html:not(:animated),body:not(:animated)").animate({
				scrollTop: destination
			}, 500);
			return false;
		});

		$(".editcomment").live("click", function() {
			event.preventDefault();
			var id = this.id.substr(4);

			$(".commentval" + id).hide();
			$(".editform" + id).show();

			$(".editform" + id + "form").submit(function() {

				$.get("myvids_modify.php?type=c&vcid=" + id, {
					commentval: $("#newcommentval" + id).val(), method: "js"
				}, function(data) {

					if (data === "false" || data === "" || data === "{$lang->myvids_commenterror}") {
						$(".editform" + id).hide();
						$(".commentval" + id).show();
						if (data === "{$lang->myvids_commenterror}") {
							alert("{$lang->myvids_commenterror}");
						}
					}
					else {
						$(".editform" + id).hide();
						$(".commentval" + id).html(data);
						$(".commentval" + id).show();
					}
				});

				return false;
			});

			$("input[name=canceledit" + id + "]").live("click", function() {
				$(".editform" + id).hide();
				$(".commentval" + id).show();
			});
		});
		
		$(".delcomment").live("click", function() {
			event.preventDefault();
			var id = this.id.substr(6);
			
			$.get("myvids_modify.php?type=c&action=delete&vcid=" + id, {method: "js"}, function(data) {

				if (data === "deleted") {
					$("#comment" + id).remove();
				}
				else {
						
				}
			});
			
		});
	});
	</script>
</head>
<body>
{$header}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
        <thead>
            <tr>
                <td class="thead" colspan="2"><strong>{$vidtitle}</strong></td>
            </tr>
        </thead>
            <tr>
                <td class="trow1" style="text-align: center;" colspan="2">
                    {$video}
                    
                    <fieldset style="text-align: left;">
                        <legend>{$lang->myvids_videodetails}</legend>
                            <strong>{$lang->myvids_addedby}</strong> <a href="member.php?action=profile&amp;uid={$userid}">{$user}</a><br />
                            <strong>{$lang->myvids_dateadded}</strong> {$videodate} at {$videotime}<br />
			    <strong>{$lang->myvids_vidcategory}</strong> <a href="myvidcategories.php?cat={$catid}">{$catname}</a>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td class="tcat" colspan="2"><strong>{$lang->myvids_video_desc}</strong></td>
            </tr>
            <tr>
                <td class="trow2" colspan="2">
                    {$viddesc}
                </td>
            </tr>
            <tr>
                <td class="tcat" colspan="2"><strong>{$lang->myvids_video_comments}</strong></td>
            </tr>
                {$addcomment}
			<tbody class="maincommentlist">
                {$videocomments}
			</tbody>
            {$pagination}
    </table>
{$footer}

(2011-04-24, 03:11 PM)Jammerx2 Wrote: [ -> ]Oh, 1.6.3 had some updates to Prototype so that could be the issue.

Edit:

Pagination works, although I do have to refresh after I add enough so it goes to the second page. Also, as a suggestion, have the date the comment was posted shown and add some flood protection since it can be spammed quite easily currently.

The date should be shown in comments in the latest version... I do need flood correction for sure though. Nickman mentioned the pagination to me too, but it's going to require quite a large change to how things work atm.
The popup now works when editing a comment, but still nothing when adding.
Hm. It definitely works when adding one on my end. How strange. Could you possibly post the contents of the myvids_addcomment template? Just to double check that's all ok. Also, if you view the page source, find the block of javascript after in the myvids_addcomment template and post that please if possible. maybe the language isn't being loaded correctly for some reason.
The code from the template is:

<tr>
    <td class="trow1" colspan="2">
        <fieldset>
            <legend>{$lang->myvids_addcomment}</legend>
            <form action="addvidcomment.php?vid={$vid}" method="post" id="addcomment">
                <textarea name="comment" style="width: 298px; height: 92px" class="commenttext"></textarea><br />
                <input type="submit" name="submit" value="{$lang->myvids_addcomment}" class="button" />
            </form>
        </fieldset>
    </td>
</tr>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

	$("#addcomment").submit(function() {

		var comment = $(".commenttext").val();
		var uid = $(".commentuid").val();

		$.post("addvidcomment.php?vid={$vid}", { comment: comment, method: "js" }, function(data) {
			$(".commenttext").val("");
		});

		var targetUrl = "videocomments.php?vid={$vid}&page=1";
			
		$.get(targetUrl, function(data) {
			$(".maincommentlist").html(data);
		});

		return false;
	});
});
</script>

Edit:

The javascript after the template:

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

	$("#addcomment").submit(function() {

		var comment = $(".commenttext").val();
		var uid = $(".commentuid").val();

		$.post("addvidcomment.php?vid=3", { comment: comment, method: "js" }, function(data) {
			$(".commenttext").val("");
		});

		var targetUrl = "videocomments.php?vid=3&page=1";
			
		$.get(targetUrl, function(data) {
			$(".maincommentlist").html(data);
                    if (data === "false" || data === "" || data === "Sorry, but the comment you entered is either too short, empty or you do not have permission to preform this action. Please try again.") {
                        $(".editform" + id).hide();
                        $(".commentval" + id).show();
                        if (data === "Sorry, but the comment you entered is either too short, empty or you do not have permission to preform this action. Please try again.") {
                            alert("Sorry, but the comment you entered is either too short, empty or you do not have permission to preform this action. Please try again.");
                        }
                    }
		});

		return false;
	});
});
</script>

Edit 2:

From looking through that preform should be perform.
Haha, yeah, slight typo in the language file xD

Odd though - your JS is correct, yet the template looks wrong. It works perfectly here on an unmodified 1.6.3. Is this on a localhost or can I get a URL?

My template for myvids_addcomment is:

<tr>
    <td class="trow1" colspan="2">
        <fieldset>
            <legend>{$lang->myvids_addcomment}</legend>
            <form action="addvidcomment.php?vid={$vid}" method="post" id="addcomment">
                <textarea name="comment" style="width: 298px; height: 92px" class="commenttext" id="message"></textarea><br />
                <input type="submit" name="submit" value="{$lang->myvids_addcomment}" class="button" />
            </form>
        </fieldset>
    </td>
</tr>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

	$("#addcomment").submit(function() {

		var comment = $(".commenttext").val();
		var uid = $(".commentuid").val();

		$.post("addvidcomment.php?vid={$vid}", { comment: comment, method: "js" }, function(data) {
			$(".commenttext").val("");
			if (data === "{$lang->myvids_commenterror}") {
				alert("{$lang->myvids_commenterror}");
			}
		});

		var targetUrl = "videocomments.php?vid={$vid}&page=1";
			
		$.get(targetUrl, function(data) {
			$(".maincommentlist").html(data);
		});

		return false;
	});
});
</script>

while yours looks slightly different (see the script area):

<tr>
    <td class="trow1" colspan="2">
        <fieldset>
            <legend>{$lang->myvids_addcomment}</legend>
            <form action="addvidcomment.php?vid={$vid}" method="post" id="addcomment">
                <textarea name="comment" style="width: 298px; height: 92px" class="commenttext"></textarea><br />
                <input type="submit" name="submit" value="{$lang->myvids_addcomment}" class="button" />
            </form>
        </fieldset>
    </td>
</tr>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

    $("#addcomment").submit(function() {

        var comment = $(".commenttext").val();
        var uid = $(".commentuid").val();

        $.post("addvidcomment.php?vid={$vid}", { comment: comment, method: "js" }, function(data) {
            $(".commenttext").val("");
        });

        var targetUrl = "videocomments.php?vid={$vid}&page=1";
            
        $.get(targetUrl, function(data) {
            $(".maincommentlist").html(data);
        });

        return false;
    });
});
</script>
Maybe it was left out in the first release, I didn't deactivate/activate so the templates weren't re-added.

Edit:

After a deactivate/activate it works fine. Other than the bugs I mentioned before, which aren't big, it's great.
Great! I'm glad of that haha. I'll be fixing the smaller bugs today, but the bugs like the front-end editing and the pagination links thing will take longer. I still need to add pagination to the administration pages, but I don't know if the usual multipage function works there too. You wouldn't happen to know before I try, would you?
Pages: 1 2 3 4 5 6 7 8 9 10