Skip to content

Instantly share code, notes, and snippets.

View kieran23101's full-sized avatar
👋
Focusing

Kieran Corkin kieran23101

👋
Focusing
View GitHub Profile
EXEC sp_MSforeachdb
'
UPDATE [?].dbo.Users
SET IsDeleted = true
WHERE Email = ''[EMAILADDRESS]'''
@kieran23101
kieran23101 / RemoveUserSQL.sql
Last active August 22, 2019 15:29
A sql script that can be run and will remove a user from every dnn installation
-- Better Version
EXEC sp_MSforeachdb
--Declaring Variables
DECLARE @var2 VARCHAR(50)
SET @var2 = ''andrew@purplecs.com''
DECLARE @var1 int
--Checking to see if Andrew exists
IF EXISTS (SELECT * FROM Users WHERE Email = @var2)
--If Andrew Exists, Run this
EXEC sp_MSforeachdb
'IF EXISTS (SELECT * FROM [?].INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = ''PaleDNN_Templates'')
BEGIN
PRINT DB_NAME(DB_ID(''?''))
END'
@kieran23101
kieran23101 / OutputTopLevelCats.cshtml
Created June 25, 2019 13:35
A razor script used for CartViper to output the top level categories - this doesnt display categories with subcategories
@using System.Dynamic;
@using System.Web.UI.HtmlControls;
@using DotNetNuke.Common;
@using DotNetNuke.Entities.Users;
@using CartViper.Modules.Store.Admin;
@using CartViper.Modules.Store.Catalog;
@using CartViper.Modules.Store.Extensions;
@using CartViper.Modules.Store.WebControls;
@using CartViper.Modules.Store.Data;
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<dynamic>
@kieran23101
kieran23101 / Animatecss-animation.js
Created May 14, 2019 09:26
This function preforms an animation on an element through js
window.animateCSS = function(element, animationName, callback) {
element.classList.add('animated', animationName)
function handleAnimationEnd() {
element.classList.remove('animated', animationName)
element.removeEventListener('animationend', handleAnimationEnd)
if (typeof callback === 'function') callback()
}
element.addEventListener('animationend', handleAnimationEnd)
}
@kieran23101
kieran23101 / Dots animations.css
Created September 6, 2018 14:22
A quick snippet that add 3 dots simulating a loading element
// <p>Loading</p>
p::after {
content: '';
position: absolute;
animation: dots 1s linear infinite;
}
@keyframes dots {
25% {
dbo.PersonaBarMenu
Change Parent Menu ID of a page that you created in the admin menu.
DNN allows you to have parent page as admin, having it in admin section allows it to be show in this DB table
@kieran23101
kieran23101 / IE Parallax Fix for scroll.js
Created July 4, 2018 08:44
Fixes the scroll lag on IE
if (navigator.userAgent.match(/Trident\/7\./)) {
// if IE
$("body").on("mousewheel", function() {
// remove default behavior
event.preventDefault();
//scroll without smoothing
var wheelDelta = event.wheelDelta;
var currentScrollPosition = window.pageYOffset;
window.scrollTo(0, currentScrollPosition - wheelDelta);
@kieran23101
kieran23101 / Change pane names of modules.sql
Last active September 6, 2018 10:57
This will search through all modules and move all the modules in one pane to the other useful for when a pane name is changed on a large website (USE FOR DNN) Tested on DNN 7
SELECT PaneName FROM dbo.TabModules
UPDATE dbo.TabModules
SET PaneName = 'NewPaneName'
WHERE PaneName = 'OldPaneName'
-- Update Using Module Title
SELECT PaneName FROM dbo.TabModules
UPDATE dbo.TabModules
SET PaneName = 'New pane name'
WHERE 'Module Title' = 'Your Title'
@kieran23101
kieran23101 / ListEditMode.cs
Last active April 12, 2021 14:15
Add accordion in edit mode for list of items
@if (DotNetNuke.Common.Globals.IsEditMode())
{
<div id="accordion-@Dnn.Module.ModuleID">
<div class="card">
<div class="card-header" id="heading-@Dnn.Module.ModuleID" >
<h5 class="mb-0">
<a class="btn btn-primary text-white" data-toggle="collapse" data-target="#collapse-@Dnn.Module.ModuleID" aria-expanded="true" aria-controls="collapse-@Dnn.Module.ModuleID">Show Admin Section</a>
</h5>
</div>
<div id="collapse-@Dnn.Module.ModuleID" class="collapse" aria-labelledby="heading-@Dnn.Module.ModuleID" data-parent="#accordion-@Dnn.Module.ModuleID">