Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Posted by Craig Last replied by outlaw16151 5 months ago

PANEL SNIPPIT:: Some Site Stats Panel

PANEL SNIPPIT:: Some Site Stats Panel


www.phpfusionmods.co.uk/../../images/some_site_stats_panel.png


Here is the code for the Some Site Stats Panel used on the homepage of this site.

Go to Admin >>> System >>> Panels >>> Add a new center panel.

Paste in this code and enable it.

Code
if (iGUEST) {
$locale['stat001'] = "Member";
$locale['stat002'] = "Members";
$locale['stat003'] = "Some Site Stats";
$locale['stat004'] = "Stats";
$locale['stat005'] = "There has been ";
$locale['stat006'] = " and ";
$locale['stat007'] = " Registered Members  since";
$locale['stat008'] = " logged in today and ";
$locale['stat009'] = " new ";
$locale['stat010'] = " registered today. ";
$locale['stat011'] = "We have ";
$locale['stat012'] = " Downloads, ";
$locale['stat013'] = " forum threads and ";
$locale['stat014'] = " forum posts.";
$locale['stat015'] = "There are ";
$locale['stat016'] = " comments";
$locale['stat017'] = " shouts posted.";

$members_registered = dbcount("(user_id)", DB_USERS, "user_status<='1' OR user_status='3' OR user_status='5'");
$members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_lastvisit > UNIX_TIMESTAMP(CURDATE())"));
$new_members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_joined > UNIX_TIMESTAMP(CURDATE())"));
$downloads = dbcount("(download_id)", DB_DOWNLOADS);
$counter = number_format($settings['counter'])." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']."");
$threads = dbcount("(thread_id)", DB_THREADS);
$posts = dbcount("(post_id)", DB_POSTS);
$comments = dbcount("(comment_id)", DB_COMMENTS);
include_once INFUSIONS."shoutbox_panel/infusion_db.php";
$shouts = dbcount("(shout_id)", DB_SHOUTBOX);
$site_opened = dbarray(dbquery("SELECT user_id, user_joined FROM ".DB_USERS." WHERE user_id='1'"));

opentable($locale['stat003']);

echo"
\n";
echo"
".$locale[
\n";
echo "
".THEME_BULLET." ".$locale['stat005'].$counter.$locale['stat006'].$members_registered.$locale['stat007']." ".showdate("longdate", $site_opened['user_joined'])."

".THEME_BULLET."  ".$members_today." ".($members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat008'].$new_members_today.$locale['stat009'].($new_members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat010']."
\n";
echo"
\n";
echo THEME_BULLET." ".$locale['stat011'].$downloads.$locale['stat012']." \n";
echo"    ".$threads.$locale['stat013'].$posts.$locale['stat014']."
\n";
echo THEME_BULLET." ".$locale['stat015'].$comments.$locale['stat016']."\n";
echo"  ".$locale['stat006'].$shouts.$locale['stat017']."\n";
   echo"
\n";
   
   closetable();
}


NOTE: This panel is configured for GUESTS only, members will not see it, only guests will.
If you want everyone to see it just remove...


Code
if (iGUEST) {


And at the bottom of the panel code remove the closing }

Code
}
7145 views 0 votes
35 posts
Posted by douwe_yntema Last replied by Wanabo 5 months ago

Isnum

This is the function isnum from maincore:

Code
// Validate numeric input
function isnum($value, $decimal=false) {
   if (!is_array($value)) {
      if($decimal==true) return (preg_match("/^[0-9]+(\.{0,1})[0-9]*$/", $value));
      return (preg_match("/^[0-9]+$/", $value));
   } else {
      return false;
   }
}


How can it be changed to accept negative numbers ass well?
390 views 0 votes
4 posts
Posted by Sladdaren Last replied by Sladdaren 5 months ago

Avatar showing when you logged in

Hi

This site looks strange nowdays i think there is som spam posted in the forum :@. Hope this site is going to be alive and active. Anyway a question

I had facebook connect installed and that infusion showed the users avatar on top of the user_info_panel.
Now i unistalled facebook connect beacasuse it dont work.
I would like to have the users avatar showing when loged in. If there is a chance i can get the avatar to showing on the left/upper side when logged in. And if there is a visitor on the site it shows nothing.

The upper/left corner in this picture i would like to have the users avatar showing when logged in.
volvosweden.se/infusions/image_hosting/../../images/6051d21f8338ecd6ef9ae732118138e3.jpg
306 views 0 votes
1 post
Posted by Homdax Last replied by Homdax 6 months ago

GDPR Landing page with some check boxes

I am struggling with a GDPR related landing page or pop up I need to make for a few 7 sites. The page as such can be simple enough, but there are a few requirements I am finding a bit hard to implement

- It has to show on user logon, only
- It should store info in user profile, so it can be verified also with datestamp, thus db entries
- I guess some kind of admin interface to handle this info might be required, thus it must be an infusion.
- maybe other stuff

I do know we have a number of 7 sites out there waiting with the 9 upgrade so I am certain this is needed and wanted for any and all EU based sites that has any kind of member registration.
Failed to fetch the attachment
464 views 0 votes
4 posts
Posted by bobsquad Last replied by Falk 7 months ago

BBCODE on Forum

Hi Guys, i am new on php fusion. And i am having a difficult on post videos with bbcode on my forum

How do i use de bbcode.. both dont work for me.. how do i get the youtube ID


When i use just the id after de = it download the swf archive
[movie=youtube][/movie]
Each one do i use?

thx
226 views 0 votes
2 posts
Posted by FreedomIOPList Last replied by Grimloch 9 months ago

Using script code in Custom Pages?

I am having trouble embedding codes in Custom Pages. Can you not embed in Custom Pages in Fusion? The code I'm trying to embed is
Code
>   var ifr = document.getElementById("JotFormIFrame-80704605582153"); if(window.location.href && window.location.href.indexOf("?") > -1) { var get = window.location.href.substr(window.location.href.indexOf("?") + 1); if(ifr && get.length > 0) { var src = ifr.src; src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get; ifr.src = src; } } window.handleIFrameMessage = function(e) { var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) { return; } switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; case "loadScript": var src = args[1]; if (args.length > 3) { src = args[1] + ':' + args[2]; } var script = document.createElement('script'); script.src = src; script.type = 'text/javascript'; document.body.appendChild(script); break; case "exitFullscreen": if (window.document.exitFullscreen) window.document.exitFullscreen(); else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen(); else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen(); else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen(); else if (window.document.msExitFullscreen) window.document.msExitFullscreen(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } 
645 views 0 votes
4 posts
Posted by FreedomIOPList Last replied by Falk 11 months ago

Problem Displaying Flash On Site Introduction

I am using the Flash Panel Code from Zazzle.com and trying to display the Flash Panel of my products on my site but for some reason, all it displays is the text and link Browse other gifts from Zazzle. instead of the Flash Panel. I am putting the code in the Site Introduction under Settings. When I go back to the Settings and look, the code is all gone except for the link. Any idea why it won't display as a Flash Panel and removes the Flash code?
425 views 0 votes
2 posts
Posted by FreedomIOPList Last replied by FreedomIOPList 11 months ago

New Donation Box Through Stripe Payment System

I hope this is the correct place to post this, I am sure others will be interested.
I found something tonight I have been waiting a long, long time for, a donation box that works with Stripe payment system and also supports Recurring Subscriptions. Sometimes people simply cannot use PayPal donations and payments. I prefer Stripe anyway. The site to create your donation box/recurring payments box is https://stripe.com/works-with/donorbox. It would be cool if someone could turn this into an Infusion/Panel kind of like the PayPal Donation Manager, which doesn't work very well. I used the Fusion Tools Panel Creator (From Netrix at the US PHP-Fusion Support Site) to create my Stripe Donation Panel and it works. I also did the same with a PayPal Donation Panel. To see it live you can visit my site at www.heavenshandmades.com and look on the left and you'll see both donation boxes. Both work as I've tested them. Hopefully this willl help someone needing donations other than PayPal.

If you need help creating a panel for your Stripe Donation Form, I'll help!

360 views 0 votes
1 post
Posted by NetriX Last replied by superboyka 1 year ago

Email Login Tutorial

Using an email address as an substitute in PHP-Fusion is both more secure and promotes anti-spam capabilities in comparison to the default username login.

As a pre-warning, if you decide to make the modifications, you will not be able to login with your username, you, along with all your websites members, will need to login using their email.

This tutorial was developed using PHP-Fusion v7.02.06. It can become backwards compatible if one knows where to edit/replace via earlier versions.

Let's get started!

---------------------------------------------------------------------------------------------

Edit the Authenticate Class: includes/classes/Authenticate.class.php

Around line 41 -

Change:

Code
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$inputUserName."' LIMIT 1");


To:

Code
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_email='".$inputUserName."' LIMIT 1");


Now all one needs to do is edit instances where the user would normally use the field UserName such as the user login panel - Change UserName to Email so as to not confuse the member to which to use.
3197 views 0 votes
3 posts
Posted by SGT-TURKEY Last replied by SGT-TURKEY 1 year ago

How to get user algorith, user password hash value

Hi everybody. I'm working hard v7

I'm working hard to manuel member registration with new bootstrap form. How to get user salt, user algoritm values...
For example

Code


   
   
   
   
    ... other user fields inputs ....
   



my php codes :
Code

if(isset($_POST["saveuser"])){
   $username=$_POST["username"];
   $userpassword=$_POST["userpassword"];
   $userpasswordagain=$_POST["userpasswordagain"];
   $usermail=$_POST["usermail"];
  $other user input values...

}


I want to get how to make user_salt values, user_passwords hash values.??

For Example :

user_salt = da7486536bcb437f91a901bdbea718e0b465c80b
user_password = b56b6ba5f2f6baa941b1333c4991bcb39897e737e1fd5c518575687b6084d59a

How to translate input value to password hash values..

Sorry my bad english...
2005 views 0 votes
4 posts
Posted by Falk Last replied by Falk 2 years ago

Div Based Table Example, highly configurable

It has some styled labels as well, dropped these out of the project but figured I would share before they poof to cyber space.

The html
Code
echo "

   

      

            Title 1
       

       

         Title 2
       

       

         Title 3
       

       

         Title 4
       

       

         Title 5
       

       

         Title 6
       

   

";

echo "

         

            

            

            

            

            

            

         

      
";


The CSS

Code
/* Div Based Table styles */   
.table {
    margin-bottom: 0px; !important;
}

div.table {
    display: table;
}

div.trHeadings {
    display: table-row;
}


div.tr {
    display: table-row;
}

div.HeadtdColumn1, div.HeadtdColumn2, div.HeadtdColumn3, div.HeadtdColumn4, div.HeadtdColumn5, div.HeadtdColumn6 {
    display: table-cell;
    padding: 6px;
    vertical-align: middle;
    border-bottom: 2px solid #fefefe;
}

div.HeadtdColumn1 {
   text-align: center;
   width: 15%;
}
div.HeadtdColumn2 {
    width: 10%;
   text-align: left;
}
div.HeadtdColumn3 {
    width: 20%;
   text-align: center;
}
div.HeadtdColumn4 {
    width: 25%;
   text-align: center;
}
div.HeadtdColumn5 {
    width: 15%;
   text-align: center;
}
div.HeadtdColumn6 {
   width: 15%;
   text-align: center;
}


div.tdColumn1, div.tdColumn2, div.tdColumn3, div.tdColumn4, div.tdColumn5, div.tdColumn6 {
    display: table-cell;
    padding: 6px;
    vertical-align: middle;
}

div.tdColumn1 {
   text-align: center;
   width: 15%;
}
div.tdColumn2 {
    width: 10%;
   text-align: left;
}
div.tdColumn3 {
    width: 20%;
      text-align: center;
}
div.tdColumn4 {
    width: 25%;
      text-align: center;
}
div.tdColumn5 {
    width: 20%;
      text-align: center;
}
div.tdColumn6 {
    width: 15%;
      text-align: center;
}


div.table-list > div.trHeadings {
    background-color: #E6ECEF;
    color: #333;
    font-size: 14px;
}

div.table-list {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
}

div.table-list > div.tr:hover  {
   background-color: #ecf7ff;
    cursor: pointer;
    cursor: hand;
}

div[class^='tdColumn'], div[class*=' tdColumn'] {
    font-size: 13px;
}
   
div.table-list > div[class^='tdColumn'], div[class*=' tdColumn'] {
    padding: 5px 10px;
    vertical-align: middle;
}

div.tdColumn6 label {
    font-size: 15px;
    font-weight: 100;
    margin: -3px 20px 0 5px;
    vertical-align: top;
    text-transform: uppercase;
    cursor: pointer;
   font-family: "proxima_nova", Arial !important;
    color: #1e202c;
}

div.tdColumn6 input[type="checkbox"] {
    -webkit-appearance: none;
    background: #fff;
    height: 14px;
    width: 14px;
    margin: 0;
    border: 1px solid #cacaca;
    outline: none;
    position: relative;
}

div.tdColumn6 input[type="checkbox"]:checked {
    background-color: #4a921b;
    border: 1px solid #4a921b;
    color: #fff;
}

div.tdColumn6 input[type="checkbox"]:checked:after {
    content: '\2714';
    font-size: 10px;
    position: absolute;
    top: 0px;
    left: 1px;
    color: #fff;
    font-family: "Times New Roman", Times, serif;
}

div.tdColumn5 label {
    font-size: 15px;
    font-weight: 100;
    margin: -3px 20px 0 5px;
    vertical-align: top;
    text-transform: uppercase;
    cursor: pointer;
   font-family: "proxima_nova", Arial !important;
    color: #1e202c;
}

div.tdColumn5 input[type="checkbox"] {
    -webkit-appearance: none;
    background: #fff;
    height: 14px;
    width: 14px;
    margin: 0;
    border: 1px solid #cacaca;
    outline: none;
    position: relative;
}

div.tdColumn5 input[type="checkbox"]:checked {
    background-color: #4a921b;
    border: 1px solid #4a921b;
    color: #fff;
}

div.tdColumn5 input[type="checkbox"]:checked:after {
    content: '\2714';
    font-size: 10px;
    position: absolute;
    top: 0px;
    left: 1px;
    color: #fff;
    font-family: "Times New Roman", Times, serif;
}
1393 views 0 votes
1 post
Posted by Anna Last replied by Falk 2 years ago

PHPMailer < 5.2.20 vulnerable

A(n) (couple of) exploit(s) have been discovered in PHPmailer.

Initial report which is patched: https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
New CVE since initial patch is still vulnerable: https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html
Explaination for dummies: https://www.wordfence.com/blog/2016/12/phpmailer-vulnerability/

Do we need to patch/update phpmailer on v7 and v9?
1246 views 0 votes
3 posts
Posted by Craig Last replied by Chan 2 years ago

The Ternary Operator

---------------------------------------------------------------------------
The Ternary Operator
---------------------------------------------------------------------------

The ternary operator takes three operands...

  • A Condition
  • A Result For True
  • A Result For False



Sounds like an if statement right?
You are right but the ternary operator is a short hand method of doing if statements. Less code is nice yes?


Here's an example:
Code

 
 $member_check = (iMEMBER) ? "You Are a Member" : "You Are A Guest";
 
 echo $member_check;

?>



First there is a condition (iMEMBER), then a question mark (?), and then a true result (You Are a Member), followed by a colon (:), and a false result (You Are A Guest). If the user is a member (iMEMBER) $member_check will be set to 'You Are a Member', else it will be set to 'You Are A Guest'.


That ternary statement would be like this in a normal if statement:

Code

 if (iMEMBER) {
       $member_check = "You Are a Member";
    } else {
       $member_check = "You Are A Guest";
    }

echo $member_check;



So, my point?
Using ternary operator's allows you to compact five lines of code into one, less code, less mess, more understandability amongst coders.
3091 views 0 votes
9 posts
Posted by Ankur Last replied by Falk 2 years ago

Prevent Spam using StopForumSpam.com

Hello Guyz,

If you want to Prevent Spam Users to get Register on your Website using the StopForumSpam.com API, in version 7.02, then you can do the steps below :

This MOD was created for v7.01.03 by Tyger. Here is How you can do it for 7.02 :

Prevention Only :

1. Open includes/classes/UserFieldsInput.class.php and find this Line :
Code
$this->_userEmail = (isset($_POST['user_email']) ? stripinput(trim(preg_replace("/ +/i", " ", $_POST['user_email']))) : "");

2. After this Line, Add the given below Code :
Code
// Check E-Mail for Spammer from stopforumspam.com
$xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$this->_userEmail);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
   $this->_setError("user_email", "You are a Reported Spammer on StopForumSpam.com ! So just stay away from my website...");
}


Save ! You are Done..... :)

Testing : To Test it if it is working or not, Go to stopforumspam.com and Choose any Banned Spammer E-Mail and try to register !!!
OR You can also Try it on my Website : http://ankurthakur.in/register.php
6726 views 0 votes
8 posts
Posted by cis5448 Last replied by cis5448 2 years ago

Edit a post with a image view/delete function

I have looked into the codes in some files about viewing a uploaded image with a delete function, but something I have missed it because when i updated the post the image disappears. What is wrong with my code???

Code
if (isset($_POST['opret_opdater'])) {
    // This is the question how to validate in Php-Fusion 9

         if (!empty($_FILES['piktogram']) && is_uploaded_file($_FILES['piktogram']['tmp_name'])) {
               $upload = form_sanitizer($_FILES['piktogram'], "", "piktogram");
               if (empty($upload['error'])) {
                $piktogram = $upload['image_name'];
               
               
               
                   addNotice("success", "Piktogram ".$piktogram." uploadet");
                  // redirect(FUSION_SELF);
               }
               $piktogram = form_sanitizer($_FILES['piktogram']['tmp_name'], "", "piktogram");
            } elseif ($data["id"] >0) {
                if (isset($_POST['del_image'])) {
                  // album_id
                  $result = dbquery("SELECT piktogram FROM ".EVO_AKTIVITET." WHERE id='".$data['id']."'");
                  if (dbrows($result) > 0) {
                     $pData = dbarray($result);
                     if ($pData['piktogram'] && file_exists(BASEDIR."billeder/piktogram/".$pData['piktogram'])) {
                        unlink(BASEDIR."billeder/piktogram/".$pData['piktogram']);
                     }
                     $piktogram = "";
                  }                     
               } else {
                  $piktogram = form_sanitizer($_POST['piktogram'], "", "piktogram");
               }
         } else {
               // because we require the photo image must be uploaded.
               $defender->stop();
               $defender->setInputError("piktogram");
               addNotice("danger", $locale['photo_0014']);
            }
           
             

           

    $data = array(

        "id" => form_sanitizer($_POST['id'], "", "id"),
        "navn" => form_sanitizer($_POST['navn'], "", "navn"),
        "piktogram" => $piktogram,
        "kategori" => isset($_POST['kategori']) ? 1 : 0,
        "menu" => isset($_POST['menu']) ? 1 : 0,
        "kontakt" => isset($_POST['kontakt']) ? 1 : 0

//print_p($data);// if validation not needed, just do like this fastest result
);

    // Use this to stop Insertion/Update to push $data downwards without refresh to see errors on input
    if (\defender::safe()) {
       if ($edit == true) {
           dbquery_insert(EVO_AKTIVITET, $data, "update");
            addNotice("success", "Aktivitet opdateret");
       } else {
       
           dbquery_insert(EVO_AKTIVITET, $data, "save");
           addNotice("success", "Aktivitet oprettet");
       }
     
       redirect("aktiviteter.php");
        //redirect(FUSION_REQUEST); // Please refresh the page to reload page for new token for the form & security reason
    }
1085 views 0 votes
1 post
Posted by Frank2012 Last replied by Falk 2 years ago

Convert text URL's in a string to an HTML link

I come and give this code for all php programmers

function to_link($string){
return preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", '$1://$2$3',$string);
}

$html = 'This line of text has three urls: http://phpsnips.com http://yahoo.com and http://google.com';

echo to_link($html, TRUE);
?>
2089 views 0 votes
3 posts
Posted by Catzenjaeger Last replied by Catzenjaeger 2 years ago

page nav

i want to add a page nav on a custom side but it doesent work

www.php-fusion.co.uk/infusions/forum/attachments/111_1.jpg

i get the settings ($asettings) from $fil_settings = get_settings("figurelib"); and the settings DB table where i have "figure_per_page"

this is my table

Quote

$inf_newtable[] = DB_FIGURE_USERFIGURES." (
figure_userfigures_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
figure_userfigures_figure_id varchar(100) NOT NULL DEFAULT '',
figure_userfigures_user_id varchar(100) NOT NULL DEFAULT '',
figure_userfigures_sorting varchar(50) NOT NULL DEFAULT '',
figure_userfigures_language VARCHAR(50) NOT NULL DEFAULT '".LANGUAGE."',
PRIMARY KEY (figure_userfigures_id)
) ENGINE=MyISAM DEFAULT CHARSET=UTF8 COLLATE=utf8_unicode_ci";


my code
Code
//nav
    $fil_settings = get_settings("figurelib");
      $max_rows = dbcount("(figure_userfigures_id)", DB_FIGURE_USERFIGURES, "figure_userfigures_user_id='".$userdata['user_id']."'");   

      $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_rows ? $_GET['rowstart'] : 0;
      
      if ($max_rows != 0) {
         
         $result = dbquery("SELECT * FROM ".DB_FIGURE_USERFIGURES." WHERE figure_userfigures_user_id='".$userdata['user_id']." LIMIT ".$_GET['rowstart'].",".$asettings['figure_per_page']);
         echo $result;
         $numrows = dbrows($result);
         $info['figure_rows'] = $numrows;
         $info['page_nav'] = $max_rows > $asettings['figure_per_page'] ? makepagenav($_GET['rowstart'], $asettings['figure_per_page'], $max_rows, 3, INFUSIONS."figurelib/mycollection.php?&") : 0;
         echo $info['page_nav'] ? "
".$info['page_nav']."
" : '';
      }
111_1.jpg 
[40.44kB / 23 Downloads]
1049 views 0 votes
7 posts
Posted by Catzenjaeger Last replied by Chan 2 years ago

push a button and some content will be hide error

i have programming a small code that show some buttons where user can add a figure from my database to their own collection.
It works but when i add this code between the other code in my site i get the following error:

--> all content under my buttons will be hide. Whats wrong? I cant find the error

www.php-fusion.co.uk/infusions/forum/attachments/1_10.jpg
www.php-fusion.co.uk/infusions/forum/attachments/2_6.jpg

The complete File is here: GITHUB

here the part what i mean:

Code
// ####### USERFIGURES  ######################################################

if (iMEMBER) {            
            global $userdata;
            $locale['userfigure_001'] ="Add to collection";
            $locale['userfigure_002'] ="Delete from collection";
            $locale['userfigure_003'] ="The following members have this Figure: ";
            $locale['userfigure_004'] ="No members have this Figure - be the first :)";
            $locale['userfigure_005'] ="FIGURE STATS";
            $locale['userfigure_006'] ="Your Collection";
            
            echo "
\n";
            echo "".$locale['userfigure_005']."
";
            echo "
\n";
            
            //Testausgaben um zu schauen was kommt
            //echo "GET figure_id:".$GET['figure_id']."
";
            //echo "DATA figure_id:".$data['figure_id']."
";
            //echo "GET user_id:".$GET['user_id']."
";
            //echo "DATA user_id (Submitter) :".$data['user_id']."
";
            //echo "USERDATA user_id:".$userdata['user_id']."
";
         
         $resultuf = dbquery(
            "SELECT          
            fu.user_id,
            fu.user_name,
            fu.user_status,
            fu.user_avatar,
            fuf.figure_userfigures_figure_id,
            fuf.figure_userfigures_user_id         
            FROM ".DB_FIGURE_USERFIGURES." fuf
            LEFT JOIN ".DB_USERS." fu ON fuf.figure_userfigures_user_id=fu.user_id   
            WHERE figure_userfigures_figure_id='".$data['figure_id']."'
            AND user_id='".$userdata['user_id']."'
            ");
            
            $rows = dbrows($resultuf);
   
         if ($rows > 0) { // FIGUR VORHANDEN
                  
               while ($datauf = dbarray($resultuf)) {
                  
                     //echo "
\n";   
                     echo "\n";
                     //echo "FIGUR VORHANDEN!
";               
                     //echo "Anzahl:".$rows;
                     //echo "figure_id:".$data['figure_id']."
";
                     //echo "user_id:".$userdata['user_id']."
";
                     //echo "userfigures_figure_id:".$datauf['figure_userfigures_figure_id']."
";
                     //echo "userfigures_user_id:".$datauf['figure_userfigures_user_id']."";
                     
                     // Form posted
                  if (isset($_POST['delete_from_collection'])) {
                     // Check Fields
                     //$criteriaArray = array(
                     //$figure_userfigures_figure_id= form_sanitizer($_POST['figure_userfigures_figure_id'], '', 'figure_userfigures_figure_id'),
                     //$figure_userfigures_user_id= form_sanitizer($_POST['figure_userfigures_user_id'], '', 'figure_userfigures_user_id'),
                     //);
                     //if (defender::safe()) {
                           //$inputArray = array(
                           //   "figure_userfigures_figure_id" => $data['figure_id'],
                           //   "figure_userfigures_user_id" => $userdata['user_id'],);
                           //dbquery("
                           //DELETE FROM ".DB_FIGURE_USERFIGURES."
                           //WHERE ".$data['figure_id']." ==  ".$datauf['figure_userfigures_figure_id']."
                           //AND ".$userdata['user_id']." ==  ".$datauf['figure_userfigures_user_id']."
                           //");
                           
                           dbquery("
                           DELETE FROM ".DB_FIGURE_USERFIGURES."
                           WHERE figure_userfigures_figure_id=".$data['figure_id']."
                           AND figure_userfigures_user_id=".$userdata['user_id']."
                           ");
                           
                           redirect(clean_request("", array("delete_from_collection"), FALSE));

                     //}
                  }
               }
                        echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "",));
                        echo form_button("delete_from_collection", $locale['userfigure_002'], $locale['userfigure_002'], array("class" => "btn btn-sm btn-primary"));
                        echo "  ".$locale['userfigure_006']."";
                        echo "  ".$locale['sale']."";
                        echo "";
                        echo "

";
                        echo closeform();
                        //echo "

\n";
                        
         } else { // FIGUR NICHT VORHANDEN
                           
                     //echo "
\n";   
                     echo "\n";   
                     //echo "FIGUR NICHT VORHANDEN!
";
                     //echo "Anzahl:".$rows;
                     //echo "userfigures_figure_id:".$datauf['figure_userfigures_figure_id']."
";
                     //echo "userfigures_user_id:".$datauf['figure_userfigures_user_id']."";
                        
                     // Form posted
                  if (isset($_POST['add_to_collection'])) {
                                 
                     // Standard Values for Fields
                     $inputArray = array(
                     "figure_userfigures_figure_id" => $data['figure_id'],
                     "figure_userfigures_figure_id" => $userdata['user_id'],
                     );

                     // Check Fields
                     //$inputArray = array(
                     //$figure_userfigures_figure_id= form_sanitizer($_POST['figure_userfigures_figure_id'], '', 'figure_userfigures_figure_id'),
                     //$figure_userfigures_user_id= form_sanitizer($_POST['figure_userfigures_figure_id'], '', 'figure_userfigures_user_id'),
                     //);

                     if (defender::safe()) {
                           $inputArray = array(
                              "figure_userfigures_figure_id" => $data['figure_id'],
                              "figure_userfigures_user_id" => $userdata['user_id'],);
                           dbquery_insert(DB_FIGURE_USERFIGURES, $inputArray, "save", array());   
                           redirect(clean_request("", array("add_to_collection"), FALSE));                           
                     }
                  }
               
                        echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "",));
                        echo form_button("add_to_collection", $locale['userfigure_001'], $locale['userfigure_001'], array("class" => "btn btn-sm btn-primary"));
                        echo "  ".$locale['userfigure_006']."";
                        echo "  ".$locale['sale']."";
                        echo "";
                        echo "

";
                        echo closeform();   
                        //echo "

\n";                                             
         }               
   }
// ###########    folgende User haben die Figure  ##################################            
            
      $resultufc = dbquery(
            "SELECT          
               fu.user_id,
               fu.user_name,
               fu.user_status,
               fu.user_avatar,
               fuf.figure_userfigures_figure_id,
               fuf.figure_userfigures_user_id         
            FROM ".DB_FIGURE_USERFIGURES." fuf
            LEFT JOIN ".DB_USERS." fu ON fuf.figure_userfigures_user_id=fu.user_id   
            WHERE figure_userfigures_figure_id='".$data['figure_id']."'
            ");      
      
      if (dbrows($resultufc) != 0) {
         
            echo "
";
            echo $locale['userfigure_003'];      
            echo "

";   
            
         while ($data = dbarray($resultufc)) {
            
            echo "\n".THEME_BULLET."\n";
            echo "\n";
            echo trimlink($data['user_name'], 15)."
\n\n";
               
         }

      } else {
            
            echo "


";
            echo $locale['userfigure_004'];   
            echo "

";            
      }

2_6.jpg 
[48.14kB / 27 Downloads]
1_10.jpg 
[49.77kB / 22 Downloads]
803 views 0 votes
2 posts
Posted by Craig Last replied by SkeeredOfMyMind 3 years ago

Tutorial:: How to make a custom home page

Tutorial:: How to make a custom home page

Many PHP-Fusion users ask these same two questions many times.

How do I make a custom home page?
How do I exclude news from the main page?


Here is how to do it.


________________________________________________



Making The Home Page File
First off we need a file that calls the PHP-Fusion maincore header and footer.
  • Copy the code below then paste into notepad++ or whatever software you use to code with.
  • Save the file naming it whatever you want your home page to be called.
  • Some suggestions for good home page names are home.php, front_page.php, or start.php
  • Upload the file to your PHP-Fusion sites main root directory.


Code

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";
?>



________________________________________________



Adding Panels To Your New Home Page
Now you have made your home page file and uploaded it to your site the next thing we will do is we will want to display some panels on it.

If we want Centre Panels to display on the new home page but we do not want the panels to display on any other page other than the new home page we do that through the Admin >>> System >>> Panels Administration on your site.

  • Go to Admin >>> System >>> Panels
  • Select Add New Upper or Lower Centre Panels
  • Select the panel you wish to use for your home page only from the panels dropdown list.
  • Go to the Panel Restriction text box and enter the name of your new home page like so /home.php
  • Select Include on these pages
  • Select Display panel on all pages
  • Set access
  • Enter your Admin Password
  • Save and enable the panel.



www.phpfusionmods.co.uk/forum/attachments/panel_restriction.png


________________________________________________



Setting Up Your Site To Open With Your New Home Page
Now we need to set up your site so that the opening page is now your new home page.

  • Go to Admin >>> Settings >>> Main
  • Scroll down to site Opening page and enter the name of your new home page like so /home.php
  • Done.



That's it done, your new home page is now set up.


________________________________________________



Some Ideas for Panels To Display on Your New Home Page
Here are two panels which I recommend for use with your new home page.

FP News Panel

www.phpfusionmods.co.uk/downloads/../../images/fp_news_panel_preview.png

FP New Panel is ideal for displaying news on your new home page you can display the news the standard single column way or double column.

FP Latest Downloads Panel

www.phpfusionmods.co.uk/downloads/../../images/fp_latest_downloads_panel_preview.png

This Latest Downloads Panel is great for home pages displays latest downloads in a nice centre panel with image thumbs and other various Downloads stats.
13482 views 0 votes
16 posts
Posted by Catzenjaeger Last replied by Catzenjaeger 3 years ago

Radio Button

since hours i try to change a normal text field to change to a yes/no radio button. I want this store in my database
I can make this so:

Code
   echo "";
   echo "";

and the data there stored in database but when i edit the data the radio buttons are empty

i don't know how i can make this correct .. i think checked is the reason but i have no luck with this

here my try:

Code
   echo "";
   echo "";
   if ($figure_limitation == "Yes") {
      echo "";
   }


can anyone help? Thanx so much
851 views 0 votes
3 posts

You can view all discussion threads in this forum.

You can start a new discussion thread in this forum.

You cannot start on a poll in this forum.

You cannot upload attachments in this forum.

You can download attachments in this forum.

Community Details
PHP-Fusion CMS Community
37.7k
Active Members
26
Online

The official English language support forum for PHP-Fusion CMS

Popular Contributors
  • Wanabo
    Wanabo
    2
  • Falk
    Falk
    2
  • Rudios
    Rudios
    2
  • Kamillo
    Kamillo
    1
  • douwe_yntema
    douwe_yntema
    1