Tutorials

General Tutorials on Installation, Configurations, plugins and community building.

52
1
WebCrew posted Aug 16 '21 at 7:52 pm

Hallo Community,


because Codoforum is a PHP system it would be quite nice if we (ya me too lol) learn PHP. That way we are able to develop our very own plugins, themes but also other systems, apps or even a CMS.


There are masses of good sources to learn PHP online and also tons of books. I found a very nice free info page which is easy to understand, is supporting a clean way to learn PHP the right way and is easy to understand.



Here you go:


Kind regards,


Andy smile


recent by apostoins  ·  Aug 22 '21 at 9:15 pm
100
2

Hallo Community


our CF @admin has shared a way about how to create a custom homepage for your CF installation. Because it was a part of another topic I thought it would be great to create a own tutorial topic about it.



Here you go


Step 1- create a page from backend like this:


6080b53db59a2


Step 2 - now add this line around line 884 in routes.php i.e replace


if ($user->can('view forum')) {

with


if ($user->can('view forum')) {
header("Location: " . RURI . "page/8");

The number 8 is from the url you see in the page created in above image.


Kind regards, Andy smile


recent by ZoeCaleb  ·  May 6 '21 at 4:53 am
69
1

Hallo Community,

should anyone of you want to change or edit the links in the dropdown menu in the header of the forum - here is the way I did it:


  • First step - go to admin backend / UIElements / Blocks:6062ef19335a9

  • Next step - create a new block and use the same settings like on my screenshot:6062ef193d6e9

  • Final step - here you can see my code example. Change it to fit your needs and thats it:


<li class='dropdown codo_dropdown'>
<span class='codo_menu_dropdown dropdown-toggle' data-toggle='dropdown'>Navigation</span>
<ul class='dropdown-menu' role='menu'>
<li class='dropdown-item'><a href='../'>Home</a></li>
<li class='dropdown-item'><a href='http://cute-but-evil.de/board/index.php?u=page/10/members'>Members</a></li>
<li class='dropdown-item'><a target="_blank" rel="noopener noreferrer" href='https://discord.gg/ZpSac3e'>Our Discord</a></li>
<li class='dropdown-item'><a href='http://cute-but-evil.de/board/index.php?u=/page/12/arc'>ARC</a></li>
<li class='dropdown-item'><a target="_blank" rel="noopener noreferrer" href='https://neverwinter.gamepedia.com/Neverwinter_Wiki'>Neverwinter WIKI</a></li>
<li class='dropdown-item'><a href='http://cute-but-evil.de/board/index.php?u=page/7'>Privacy / DSGVO</a></li>
- <li class='dropdown-item'><a href='http://cute-but-evil.de/board/index.php?u=page/8'>Impressum / Imprint</a></li>
</ul>
</li>

I hope it will help you smile


Kind regards, Andy smile


recent by admin  ·  Mar 31 '21 at 8:53 am
59
1
pupsik posted Jul 11 '20 at 5:48 pm

Transliterator is an abstract class that transliterates text from one format to another. Russian to Latin transliterator changes Russian text written in Cyrillic characters to phonetically equivalent Latin characters.

Only useful for Russian speaking community!

Open sites/default/assets/js/editor.js

Add on top right after:

//avoid alt+e and alt+f key combinations

This:

var CapsState = false;

function copy() {
  let textarea = document.getElementById("textarea");
  textarea.select();
  document.execCommand("copy");
}

function initArray() 
{
    this.length = initArray.arguments.length
    for (var i = 0; i < this.length; i++)   
        this[i+1] = initArray.arguments[i]
}

eng_letters = new initArray(1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1042,1065,1061,1067,1047,91,92,93,94,95,96,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1074,1097,120,1099,1079);
second_order = new initArray(72,79,69,85,65,72,77,79,85,65,72,104,111,101,117,97,104,109,111,117,97,104);
first_order  = new initArray(1062,1049,1049,1049,1049,1057,1065,1067,1067,1067,1047,1094,1081,1081,1081,1081,1089,1097,1099,1099,1099,1079);
two_result = new initArray(1063,1025,1069,1070,1071,1064,1068,1025,1070,1071,1046,1095,1105,1101,1102,1103,1096,1100,1105,1102,1103,1078);

var nexto = 1;
var language = (navigator.appName=='Netscape');

function getlanguagename()
{
    if (language==1) return "Eng";
    if (language==0) return "Rus";
}

function changelanguage()
{
if (language==1) {language=0; document.translitform.rus_eng.value="Rus"; document.translitform.input_text.focus();return 0}
if (language==0) {language=1; document.translitform.rus_eng.value="Eng"; document.translitform.input_text.focus();return 0}
}

function translate_letter()
{
    if(navigator.appName=='Netscape')
    {
        if (language==0) 
        {
            changelanguage();
            alert("The language is swithched to English. Please complete the text and press 'TRANSLITERATE ALL' button");
        }
        return true;
    }
        if (language==1) {return true;}
    var txt = document.translitform.input_text.value;
    l1 = txt.substr(txt.length - 1,1);
    var code = l1.charCodeAt(0); 
    l2 = txt.substr(txt.length-2,1);
    var code2 = l2.charCodeAt(0);
    if ((code==39)||(code==35))
    //' and '' and # and ## treatment
    {
        if (code==39) 
        {
            var newcode =1100;
            var doublecode =1068;
        }
        if (code==35) 
        {
            var newcode =1098;
            var doublecode =1066;
        }

        var res = String.fromCharCode(newcode);        
        txt = txt.substr(0, txt.length-1);
        if (code2==newcode) 
        { 
            res = String.fromCharCode(doublecode);
            txt = txt.substr(0, txt.length-1);
        }

        document.translitform.input_text.value = txt + res;
                document.translitform.input_text.focus();
    }

    if ((code<123) && (code>64)) 
    {
        var res = String.fromCharCode(eng_letters[code-64]);
        var rus_code = eng_letters[code-64];
        txt = txt.substr(0, txt.length-1);
        if (nexto==0)
        { 
            nexto = 1;
            for (i = 1; i<25; i++)
            {
                if (rus_code == first_order[i]) nexto = 0; 
                if ((code==second_order[i])&&(code2==first_order[i])) 
                { 
                    res = String.fromCharCode(two_result[i]);
                    txt = txt.substr(0, txt.length-1);
                    break;
                }
            }
        }
        else nexto = 0;

                document.translitform.input_text.focus();
        document.translitform.input_text.value = txt + res;

    }
}


function translatesymbol(pretxt,txt)
{
    var res = pretxt+txt;
    var code = txt.charCodeAt(0); 
    var code2 = pretxt.charCodeAt(0);

    if ((code==39)||(code==35))
    //' and '' and # and ## treatment
    {
        if (code==39) 
        {
            var newcode =1100;
            var doublecode =1068;
        }
        if (code==35) 
        {
            var newcode =1098;
            var doublecode =1066;
        }

        res = pretxt+String.fromCharCode(newcode);        

        if (code2==newcode) 
        { 
            res = String.fromCharCode(doublecode);
        }
    }

    if ((code<123) && (code>64)) 
    {
        res = pretxt+String.fromCharCode(eng_letters[code-64]);
        for (i = 1; i<25; i++)
        { 
            if ((code==second_order[i])&&(code2==first_order[i])) 
            { 
                res = String.fromCharCode(two_result[i]);
                break;
            }
        }
    }
    return res;
}

function translateAll()
{
    var txt = document.translitform.input_text.value;
    var txtnew = translatesymbol("",txt.substr(0,1));
    var symb = "";
    for (kk=1;kk<txt.length;kk++)
    {
        symb = translatesymbol(txtnew.substr(txtnew.length-1,1),txt.substr(kk,1));
        txtnew = txtnew.substr(0,txtnew.length-1) + symb;
    }
    document.translitform.input_text.value = txtnew;
    document.translitform.input_text.focus();
}

     function onClickKBButtonEx(btn)
     {
    if (btn == 'Caps')
        CapsState = !(CapsState)
        else
    { 
        var txt = document.translitform.input_text.value;
        if (btn == 'BkSp')
        {
            txt = txt.substr(0, txt.length - 1);
        }
        else
        {
            txt = txt + btn;
        }
        document.translitform.input_text.value = txt;
    }
        document.translitform.input_text.focus();
     }
     function onClickKBButton(btn)
     {
    var code = btn.charCodeAt(0);
    if (CapsState == false)
    {
        if (code == 168) 
                   code = 184;
        else if (code == 1025)
           code = 1105;
        else
                   code = code + 32;
    }
    btn = String.fromCharCode(code);
    onClickKBButtonEx(btn);
     }

Find:

],
    previewInElement: jQuery('#codo_new_reply_preview'),

Add Before:

{name: 'Translit', className: "translit", replaceWith: translateAll},

(That is if you are using my colors and headers bbcode change)
Save and close.

open sites/default/themes/default/less/editor.less

Find:

.markItUp .preview a {
    background-image:url(../img/preview.png);
}

Add before:

.markItUp .translit {
   left: 340px;
   position: absolute;
}
.markItUp .markItUpButton13 a    {
    background-image:url(../img/translit.png);
}

Add image to sites/default/themes/default/img
5f09f48d20b38

Open sites/default/themes/default/templates/forum/new_topic.tpl
Find:

<form id="codo_new_reply_post"  method="POST" class="" role="form">

Replace with:

<form method="post" id="codo_new_reply_post" onsubmit="return false;" name="translitform" enctype="multipart/form-data" role="form">

Find:

<textarea placeholder="{_t('Describe your topic . You can use BBcode or Markdown')}" id="codo_new_reply_textarea" name="input_text">{$topic.imessage}</textarea>

Open sites/default/themes/default/templates/forum/topic.tpl

Find:

<form id="codo_new_reply_post" action="/" method="POST">

Replace with:

<form id="codo_new_reply_post" action="/" onsubmit="return false;" name="translitform" enctype="multipart/form-data" method="POST">

Find:

<textarea placeholder="{_t('Start typing here . You can use BBcode or Markdown')}" id="codo_new_reply_textarea" name="input_text"></textarea>

Replace with:

<textarea onkeyup="translate_letter()" placeholder="{_t('Start typing here . You can use BBcode or Markdown')}" id="codo_new_reply_textarea" name="input_text"></textarea>

Done!

recent by pupsik  ·  Jul 11 '20 at 6:28 pm
263
4

Hallo Community,
Hallo @admin & @adesh

Many Internet users want to use a day and night mode in our time. I thought about this topic and I think our awesome Codologic Team should be able to enable this feature for us in the future with only little effort.

I already wrote the following CSS to help the Codologic Team a little.

This code recognizes whether the user uses the browser integrated day and night mode which is already supported by most modern browsers and has activated the night or day theme.

If a user uses night mode, Codoforum will also be available in dark colors in the future.

Here is the CSS (yes it is very small but completely sufficient):

@media (prefers-color-scheme: dark) {
  img {
    opacity: .75;
    transition: opacity .5s ease-in-out;
  }
  img:hover {
    opacity: 1;
  }

  html {
  --text-color-normal: #0a244d;
  --text-color-light: #8cabd9;
  }

html[data-theme='dark'] {
  --text-color-normal: hsl(210, 10%, 62%);
  --text-color-light: hsl(210, 15%, 35%);
  --text-color-richer: hsl(210, 50%, 72%);
  --text-color-highlight: hsl(25, 70%, 45%);
  }
}

If wanted You can check if the browser supports it using Javascript:

if (window.matchMedia('(prefers-color-scheme)').media === 'not all') {
  console.log('Browser doesn\'t support dark mode');
}

Good luck and thanks for Your interest,
Andy

recent by pupsik  ·  Jun 25 '20 at 8:44 pm
66
1

Here is a slution worked out by our member @pupsik about how you can have some text color option within the forums editor.

Tutorial starts here:

Please note, this is pupsik`s edit and it works, it might not be the best solution or someone might did it different. The pictures he used are original MarkitUp images to fit the style. You may use any others.

Open: sites/default/assets/js/editor.js

Find:

{name: 'Headers', className: "heading", dropMenu: [
Replace with:

{separator:'---------------' },
      {name:'Colors', className: "colors", key: 'C', openWith:'[color=[![Color]!]]', closeWith:'[/color]', dropMenu: [
      {name:'Yellow', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" },
      {name:'Orange', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" },
      {name:'Red', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" },
      {name:'Blue', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" },
      {name:'Purple', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" },
      {name:'Green', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" },
      {name:'White', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" },
      {name:'Gray', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" },
      {name:'Black', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" }
  ]},


  {name: 'Headers', className: "fonts", dropMenu: [

Open: sites/default/themes/default/less/editor.less

Find:

.markItUp .markItUpButton9 a    {
    background-image:url(../img/smileyimg.png);
}
Add after:

.markItUp .colors {
   left: 300px;
   position: absolute;
}

.markItUpHeader .colors ul{
    top: 23px;
    z-index:300;
}

.markItUpHeader .markItUpButton11 a {
    background-image:url(../img/colors.png);
    top: 23px;
    z-index:300;
}

    .markItUpHeader .markItUpButton11 ul {
        width:81px;
        padding:1px;

    }
    .markItUpHeader .markItUpButton11  li {
        border:1px solid white;
        width:25px;    height:25px;
        overflow:hidden;
        padding:0px; margin:0px;
        float:left;    
    }

    .markItUpHeader .markItUpButton11 ul a {
        width:25px;    height:25px;
    }

    .markItUpHeader .markItUpButton11 ul a:hover {
        background-color:none;
    }

    .markItUp .markItUpButton11 .col1-1 a {
        background:yellow;
    }
    .markItUp .markItUpButton11 .col1-2 a {
        background:orange;
    }
    .markItUp .markItUpButton11 .col1-3 a {
        background:red;
    }

    .markItUp .markItUpButton11 .col2-1 a {
        background:blue;
    }
    .markItUp .markItUpButton11 .col2-2 a {
        background:purple;
    }
    .markItUp .markItUpButton11 .col2-3 a {
        background:green;
    }

    .markItUp .markItUpButton11 .col3-1 a {
        background:white;
    }
    .markItUp .markItUpButton11 .col3-2 a {
        background:gray;
    }
    .markItUp .markItUpButton11 .col3-3 a {
        background:black;
    }


.markItUp .fonts {
   left: 320px;
   position: absolute;
}

.markItUpHeader .fonts ul{
    top: 23px;
    z-index:300;
}

.markItUp .markItUpButton12 a {
    background-image:url(../img/fonts.png);
}

.markItUpHeader .markItUpButton12  li {

        border:1px solid white;
        overflow:hidden;
        padding:0px; margin:0px;
        float:left;
}
.markItUp .markItUpButton12 .header1 > a{
    background-image:none;
    font-size: 2em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;
}

.markItUp .markItUpButton12 .header2 > a{
    background-image:none;
    font-size: 1.5em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;

}
.markItUp .markItUpButton12 .header3 > a{
    background-image:none;
    font-size: 1.17em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;

}
.markItUp .markItUpButton12 .header4 > a{
    background-image:none;
    font-size: 1em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}
.markItUp .markItUpButton12 .header5 > a{
    background-image:none;
    font-size: .83em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}
.markItUp .markItUpButton12 .header6 > a{
    background-image:none;
    font-size: .75em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}
Note! Add styles to the theme you are using or to all of them.
Optional: I no longer use headers as a style, so I deleted this:

.markItUp .heading {
    border-radius: 2px;
    -webkit-box-shadow: rgba(255, 255, 255, 0.0980392) 1px 1px inset, rgba(0, 0, 0, 0.0980392) 1px 1px;
    box-shadow: rgba(255, 255, 255, 0.0980392) 1px 1px inset, rgba(0, 0, 0, 0.0980392) 1px 1px;
    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.0980392), transparent);
    background-repeat: repeat-x;
    background-color: @markItUpHeadingBg;
    color: @markItUpHeadingColor;
    border-color: rgba(0, 0, 0, 0.298039);
    .transition(0.3s linear box-shadow);
    padding-bottom: 0px;
    padding-top: 2px;
    padding-right: 4px;
    margin-left: 10px;
    margin-top: 7px;
    position: absolute;
    left: 280px;    
}


.markItUpHeader .heading:hover {

    border-color: @markItUpHeadingHoverBorder;
}

.markItUp .heading:hover {
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(transparent), color-stop(40%, rgba(0, 0, 0, 0.05)), to(rgba(0, 0, 0, 0.1)));
    background-image: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
    background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.05) 0, rgba(0, 0, 0, 0.1));
    background-image: -ms-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
    background-image: -o-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
    background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));

}

.markItUpHeader .heading > a{

    text-indent: 0;
    width: 50px;
    height: 20px;
    text-align: center;
    cursor: pointer;
    color: @markItUpHeading_A_color;
}


.markItUpHeader > ul > li > a {

    background-size: contain;
}

.markItUp .heading > ul > li > a {

    width: 100%;

}

.markItUp .heading .header1 > a{

    font-size: 2em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;
}

.markItUp .heading .header2 > a{

    font-size: 1.5em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;

}
.markItUp .heading .header3 > a{

    font-size: 1.17em;
    font-weight: bold;
    line-height: 33px;
    height: 43px;

}
.markItUp .heading .header4 > a{

    font-size: 1em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}
.markItUp .heading .header5 > a{

    font-size: .83em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}
.markItUp .heading .header6 > a{

    font-size: .75em;
    font-weight: bold;
    line-height: 20px;
    height: 30px;
}


.markItUpHeader .heading ul{

    background: white;
    border: 1px solid @markItUpHeaderHeadingUlBorder;
    top: 23px;
    left: -1px;
    padding: 6px 0px;
    width: 200px;
    z-index:300;

}

.markItUpHeader .heading ul li {

    text-align: left;
    line-height: 8px;
    border-bottom: 0;
    margin: 0;
    padding: 0;
}

That's it. You can now add 2 images colors.png and fonts.png to your theme. Default sites/default/themes/default/img. Overridte existing images if you feel like it.

Enjoy!

Kind regards from Andy and @pupsik smile

recent by pupsik  ·  Jun 25 '20 at 1:43 am
22
0
Adamstiffman posted Jun 7 '20 at 10:53 am

Learn about all date function which is used to manipulate in the SQL server with the help of Date function in SQL for example - CURRENT_TIMESTAMP function in SQL, DATEADD, DATENAME.

CURRENT_TIMESTAMP function in SQL : -

SQL gives a function to the user which helps to return the current date and time in the SQL server and that function is known as CURRENT_TIMESTAMP function.

Syntax : - 
CURRENT_TIMESTAMP

This function gives date and time in the format 'yyyy-mm-dd hh:mm:ss.mmm'.

See the example : -

SELECT CURRENT_TIMESTAMP;
Result: '2014-05-01 14:19:55.918'

DATEADD function in SQL : -
DATEADD function in SQL helps to give a date after adding or subtracting the interval from the date.

Syntax:- 
DATEADD( interval, number, date )

Example : -


SELECT DATEADD(year, 1, '2014/05/29');
Result: '2015-05-29 00:00:00.000'

SELECT DATEADD(year, 1, '2014/05/29');
Result: '2015-05-29 00:00:00.000'

SELECT DATEADD(year, 1, '2014/05/29');
Result: '2015-05-29 00:00:00.000'

SELECT DATEADD(year, -1, '2014/03/23');
Result: '2013-03-23 00:00:00.000'

SELECT DATEADD(month, 1, '2014/09/18');
Result: '2014-09-18 00:00:00.000'

SELECT DATEADD(month, -1, '2014/04/28');
Result: '2014-03-28 00:00:00.000'

SELECT DATEADD(day, 1, '2014/04/28');
Result: '2014-04-29 00:00:00.000'

SELECT DATEADD(day, -1, '2014/04/28');
Result: '2014-04-27 00:00:00.000'

DATEDIFF function in SQL : -
DATEDIFF function tells about the between two date values, based on the interval specified.

Syntax:- 
DATEDIFF( interval, date1, date2 )

The interval used to calculate the difference between date1 and date2.

Example : -


SELECT DATEDIFF(year, '2012/01/18', '2014/01/28');
Result: 2

SELECT DATEDIFF(yyyy, '2010/04/28', '2012/04/28');
Result: 2

SELECT DATEDIFF(yy, '2010/04/28', '2012/04/28');
Result: 2

SELECT DATEDIFF(month, '2014/01/01', '2014/04/28');
Result: 3

SELECT DATEDIFF(day, '2014/01/01', '2014/04/28');
Result: 117

SELECT DATEDIFF(hour, '2014/04/28 08:00', '2014/04/28 10:45');
Result: 2

SELECT DATEDIFF(minute, '2014/04/28 08:00', '2014/04/28 10:45');
Result: 165

DATENAME in SQL : -
DATENAME function in SQL gives the specified part of the of a given date, as a string value

Syntax:- 
DATENAME( interval, date )

it will return the result in the string.

Example : -

SELECT DATENAME(year, '2014/04/28');
Result: '2014'

SELECT DATENAME(yyyy, '2012/04/28');
Result: '2012'

SELECT DATENAME(yy, '2010/04/28');
Result: '2010'

SELECT DATENAME(month, '2014/01/28');
Result: 'Jan'

SELECT DATENAME(day, '2014/04/19');
Result: '19'

SELECT DATENAME(quarter, '2014/04/28');
Result: '2'

SELECT DATENAME(hour, '2014/04/28 09:49');
Result: '9'

SELECT DATENAME(minute, '2014/04/28 09:49');
Result: '49'

SELECT DATENAME(second, '2014/04/28 09:49:12');
Result: '12'

SELECT DATENAME(millisecond, '2014/04/28 09:49:12.726');
Result: '726'

DATEPART in SQL : -

DATEPART function in SQL gives the specified part of the of a given date, as an integer value.

Syntax:- 
DATEPART( interval, date )

it will return the result in the integer.

Example : -



SELECT DATENAME(year, '2014/04/28');
Result: '2014'

SELECT DATENAME(yyyy, '2012/04/28');
Result: '2012'

SELECT DATENAME(yy, '2010/04/28');
Result: '2010'

SELECT DATENAME(month, '2014/01/28');
Result: '1'

SELECT DATENAME(day, '2014/04/19');
Result: '19'

SELECT DATENAME(quarter, '2014/04/28');
Result: '2'

SELECT DATENAME(hour, '2014/04/28 09:49');
Result: '9'

SELECT DATENAME(minute, '2014/04/28 09:49');
Result: '49'

SELECT DATENAME(second, '2014/04/28 09:49:12');
Result: '12'

SELECT DATENAME(millisecond, '2014/04/28 09:49:12.726');
Result: '726'

DATEPART in SQL : -
DAY function tells about the day of the month (between 1 to 31) given a date value.

Syntax:- 
DAY( date_value )

Example : -


SELECT DAY('2014/04/22');
Result: 22

SELECT DAY('2014/03/23 10:05');
Result: 23

SELECT DAY('2014/04/11 10:05:18.621');
Result: 11

````GETDATE SQL function : -
GATEDATE function in SQL gives you the current date and time just like the CURRENT_TIMESTAMP function.

Syntax:-
GETDATE ( )


Example : -

SELECT GETDATE();
Result: '2014-04-28 18:17:28.160'

````GETUTCDATE SQL function : -
GETUTCDATE function for SQL server returns the current UTC date and time.

Syntax:-
GETUTCDATE ( )

Example : - 
SELECT GETUTCDATE();
Result: '2014-04-29 00:27:58.657'

MONTH Function in SQL : -
MONTH function tells about the MONTH of the month (between 1 to 12) given a date value.

Syntax:- 
MONTH( date_value )
Example : - 


SELECT MONTH('2014/02/28');
Result: 2

SELECT MONTH('2014/01/31 10:05');
Result: 1

SELECT MONTH('2014/10/01 10:05:18.621');
Result: 10

MONTH Function in SQL : -

MONTH function tells about the four-digit year (in number) given a date value.

Syntax:-

YEAR( date_value )

Example : -

```` 
SELECT YEAR('2012/04/28');
Result: 2012

SELECT YEAR('2009/03/31 10:05');
Result: 2009

SELECT YEAR('2011/12/01 10:05:18.621');
Result: 2011

````

70
4

Hi Community smile

If You want that Your users will get redirected to the forum home and not to profile page then follow my simple tutorial, please.

  • To edit the following file use a code Editor like Notepad++ or Sublimem both are free):

  • Open: codoforum\sites\default\themes\default\templates\user*login.tpl
    Go to
    line number 161 and replace the default code - this one*
    :

window.location.href = codo_defs.url + 'user/profile';
  • with that one:
window.location.href = codo_defs.url;
  • Now save, upload the file, recache browser and it should do the trick.

Kind regards,

Andy


P.S.: If You are using a other Codoforum theme, make sure to check if there is a login.tpl included (if not then all is fine). If yes then do the same with that template, please.

recent by admin  ·  May 6 '20 at 10:20 am
126
1
WebCrew posted Oct 31 '19 at 1:53 am

Hallo Community,

our superhero and Codologic mastermind smile@admin (Adesh) has answered a topic of a user who had problems with his SMTP settings. I thought it would be a good idea to share Adesh`s answer at the tutorials section of CF.

Here we go:

Hi,

Gmail has made its SMTP authentication more strict. You will have to do two things:

Open security checkup :

There it will probably show a critical issue saying there was a recent sign in from a server (your server)
You need to say it was you and allow access.

Then you need to allow access from 3rd party apps by enabling this setting:
https://myaccount.google.com/u/1/lesssecureapps

If you have multiple gmail accounts, make sure you are doing above steps using the account that you have configured in codoforum.

Another thing you can try is change protocol to tls and port to 587

recent by admin  ·  Nov 2 '19 at 10:23 am
66
0

I have made a page in non-wordpress website which is showing the post from blog of wordpress website, it is working properly. I have added some PHP code in my page. Now I want that every time I refresh the page it will show different different post every time.

<?php 
  define('WP_USE_THEMES', false);
  require('blog/wp-load.php');
  query_posts('showposts=4');
?>

<ul style="margin-top:0px">

<?php while (have_posts()): the_post(); ?>
 <li style="border: 1px solid #edf4fc;margin-bottom:30px">
<div class="img-hover-zoom">
  <a target="_blank" href="<?php the_permalink(); ?>"><p>
  <?php
    if ( has_post_thumbnail() ) {
      the_post_thumbnail();
    }
  ?>
 </p>
 <div class="content">
 <h4 style="font-size:18px;"><?php the_title(); ?></h4>

</div>
</a></div>
 </li>

<?php endwhile; ?>
</ul>
175
0

Hallo CF Community,


I came across an excellent little script on the internet that is open source and anyone can freely use it even for commercial purposes.


With this script, the Codoforum "Pages" feature and some knowledge of HTML, you can get in only a few steps a complete shop with a shopping card and a checkout with paypal express, google checkout, and amazon payments.


Even webmasters with basic HTML knowledge should be able to setup a shop. For example thats the HTML code for one product - ya it is that simple:


<div class="simpleCart_shelfItem">
<h2 class="item_name">Item Name Goes Here</h2>
<img src="item-image.jpg" alt="Item Alt">
<span class="item_price">$19.99</span>
<a href="javascript:;" class="item_add">Add to Cart</a>
</div>

Simply create a new page at the CF backend and call it Shop. There You call a tiny JS script and Your Shops HTML and Youre ready to sell Your goods. No database needed smile


Here you can find everything you need to know:



Good luck and much success!


Kind regards, Andy


77
1
Bhaskar posted May 25 '19 at 12:24 pm
$conn=mysqli_connect('localhost:8080', 'root', ' ','user_accounts' );
$sql="INSERT INTO users
    (name,Lastname,Email_ID,Phonenumber,Password)
    VALUES($firstname,$lastname,$email,$phonenumber,$password)";


if($is_query_run=mysqli_query($conn,$sql))
{
    echo 'Query successfully executed';
    //$query_execute=mysqli_fetch_assoc($is_query_run)
}

Why am i unable to insert data into the database?

recent by admin  ·  May 26 '19 at 3:33 pm
39
68
2
Actions
Hide topic messages
Enable infinite scrolling
Previous
12
Next
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft