Looking for the old forum?

For topics posted before June 2015, please click here to visit the old support forum. Post your questions in this forum if you have any questions.

Support Forums
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Oct 2016 10:14 PM by  Pengtsen R
Sitemap for UVG
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:18
New Member


--
21 Nov 2015 04:19 AM
    Code

    using DotNetNuke.Common.Utilities;
    using DotNetNuke.Entities.Modules;
    using DotNetNuke.Entities.Portals;
    using DotNetNuke.Services.Sitemap;
    using System;
    using System.Collections;
    using System.Collections.Generic;

    namespace BizModules.UltraVideoGallery
    {
    public class SiteMapProvider : SitemapProvider
    {
    private Dictionary<int, float> _modulePriority = new Dictionary<int, float>();
    private Dictionary<int, int> _modulePriorityFieldId = new Dictionary<int, int>();
    private Dictionary<int, int> _viewpage = new Dictionary<int, int>();

    private SitemapUrl GetBlogUrl(int portalId, VideoInfo videoInfo)
    {
    if (!this._modulePriority.ContainsKey(videoInfo.ItemId))
    {
    this._modulePriority.Add(videoInfo.ItemId, 0.5f);
    this._modulePriorityFieldId.Add(videoInfo.ItemId, -1);
    }
    float num = this._modulePriority[videoInfo.ItemId];
    int objField = this._modulePriorityFieldId[videoInfo.ItemId];
    return new SitemapUrl { Url = videoInfo.PlayUrl, Priority = num, LastModified = videoInfo.LastModifiedDate, ChangeFrequency = SitemapChangeFrequency.Weekly };
    }

    public override List<SitemapUrl> GetUrls(int portalId, PortalSettings ps, string version)
    {
    List<SitemapUrl> tours = new List<SitemapUrl>();
    VideoController videoController = new VideoController();

    string name = Enum.GetName(typeof (VideoOrderType), VideoOrderType.AlphabeticalOrder);

    foreach (VideoInfo videoInfo in VideoController.SearchPlus(portalId, -1, "", "", name))
    {
    SitemapUrl blogUrl = this.GetBlogUrl(portalId, videoInfo);
    tours.Add(blogUrl);
    }
    return tours;
    }
    }



    web.config

    <add name="UltraVideoGallerySitemapProvider" type="BizModules.UltraVideoGallery.SiteMapProvider, BizModules.UltraVideoGallery" providerPath="~\desktopmodules\UltraVideoGallery\Components\" />


    New Member


    Posts:18
    New Member


    --
    21 Nov 2015 12:46 PM
    For profanity filter in comment system please add this code

    var ps = new DotNetNuke.Security.PortalSecurity();
    string Comment = ps.Remove(objComment.Comment, DotNetNuke.Security.PortalSecurity.ConfigType.ListController, "ProfanityFilter", DotNetNuke.Security.PortalSecurity.FilterScope.SystemAndPortalList);


    New Member


    Posts:18
    New Member


    --
    22 Nov 2015 01:58 AM
    Video Url for Unicode Titles

    http://mysite.com/Player/VideoId/38/-------

    SEO-Friendly Site URL

    http://mysite.com/Player/VideoId/38/?????-????


    Url = Url.Replace(' ','-');
    Regex regex = new Regex(@"(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?");

    Match match = regex.Match(Url);

    Url = match.Value;

    OR

    [!@#$%^&*()}{|\" ?><\[\]\\;',~]

    OR


    public static string ToUrlSlug(string value){

    //First to lower case
    value = value.ToLowerInvariant();

    //Remove all accents
    var bytes = Encoding.GetEncoding("Cyrillic").GetBytes(value);

    value = Encoding.ASCII.GetString(bytes);

    //Replace spaces
    value = Regex.Replace(value, @"\s", "-", RegexOptions.Compiled);

    //Remove invalid chars
    value = Regex.Replace(value, @"[^\w\s\p{Pd}]", "",RegexOptions.Compiled);

    //Trim dashes from end
    value = value.Trim('-', '_');

    //Replace double occurences of - or \_
    value = Regex.Replace(value, @"([-_]){2,}", "$1", RegexOptions.Compiled);

    return value ;
    }




    Basic Member


    Posts:240
    Basic Member


    --
    22 Nov 2015 08:35 PM
    I integrated your recommendataion for the video name in the URL, it should be included in next minor upgrade.


    New Member


    Posts:18
    New Member


    --
    07 Sep 2016 01:36 PM
    Why not added !!??
    I'm trying to fix the problems, and I love these problems in the next version is not


    Basic Member


    Posts:189
    Basic Member


    --
    12 Sep 2016 10:02 PM
    I am not exactly sure which future you were talking about. Can you be more specefic?


    New Member


    Posts:18
    New Member


    --
    16 Sep 2016 01:50 AM
    My video title is [معرفی مرسدس-AMG سی کلاس نسخه AMG کانورتیبل] unicode title and in url
    htpp://mydomain.com/Player/VideoId/1/معرفی مرسدس-AMG سی کلاس نسخه AMG کانورتیبل




    Basic Member


    Posts:189
    Basic Member


    --
    06 Oct 2016 10:14 PM
    Some code in this part has been added. However, the unicode-in-url one is not added for SEO concerns.
    You are not authorized to post a reply.


    Copyright © 2005-2013 BizModules Contact us