1321
wishcraft
Re: SmartProfile - edituser.php & /admin/user.php

Starting at Line 144 (/admin/user.php) you need to alter it to read

foreach (array_keys($fields) as $i) {
            
$fieldname $fields[$i]->getVar('field_name');
            if (
in_array($fields[$i]->getVar('fieldid'), $editable_fields) && ($fields[$i]->getvar('field_type') != "image" || isset($_REQUEST[$fieldname]))) {
                if (
in_array($fieldname$profile_handler->getUserVars())) {
                    
$value $fields[$i]->getValueForSave($_REQUEST[$fieldname], $user->getVar($fieldname'n'));
                    
$user->setVar($fieldname$value);
                }
                else {
                    
$value $fields[$i]->getValueForSave((isset($_REQUEST[$fieldname]) ? $_REQUEST[$fieldname] : ""), $profile->getVar($fieldname'n'));
                    
$profile->setVar($fieldname$value);
                }
            } elseif (
$fields[$i]->getvar('field_type') == "image"){
               
$value $fields[$i]->getValueForSave($fieldname$profile->getVar($fieldname'n'),$imageindex);
               
$profile->setVar($fieldname$value);
            }

        }


And starting line 78 you need to alter the foreach also to read

foreach (array_keys($fields) as $i) {
        
$fieldname $fields[$i]->getVar('field_name');
        if (
in_array($fields[$i]->getVar('fieldid'), $editable_fields) && ($fields[$i]->getvar('field_type') != "image" || isset($_REQUEST[$fieldname]))) {
            if (
in_array($fieldname$profile_handler->getUserVars())) {
                
$value $fields[$i]->getValueForSave($_REQUEST[$fieldname], $edituser->getVar($fieldname'n'));
                
$edituser->setVar($fieldname$value);
            }
            else {
                
$value $fields[$i]->getValueForSave((isset($_REQUEST[$fieldname]) ? $_REQUEST[$fieldname] : ""), $profile->getVar($fieldname'n'));
                
$profile->setVar($fieldname$value);
            }
        } elseif (
$fields[$i]->getvar('field_type') == "image"){
                
$value $fields[$i]->getValueForSave($fieldname$profile->getVar($fieldname'n'),$imageindex);
               
$profile->setVar($fieldname$value);

            
        }
    }


The changes to /class/field.php need to be changed as you can't do an isset on a $_FILES object it will always read true.

Starting at line 363 of the select case you need to make the following changes through to the fetchmedia call, the case statement should read

case "image":
                foreach (
$_POST['xoops_upload_file'] as $result){
                    
$count++;
                    if (
$result==$this->getVar('field_name')){
                        
$index $count-1;
                        break;
                    }
                }
                
                if (!isset(
$_FILES[$_POST['xoops_upload_file'][$index]])||$_FILES[$_POST['xoops_upload_file'][$index]]['error']==4) {
                    return 
$oldvalue;
                } else {
                    
//print_r($_FILES[$_POST['xoops_upload_file'][$index]]);
                
}
                
/*if (!isset($_FILES[$this->getVar('field_name')])) {
                    return $oldvalue;
                }*/
                
$options $this->getVar('field_options');
                
$dirname XOOPS_UPLOAD_PATH."/smartprofile";
                if (!
is_dir($dirname)) {
                    
mkdir($dirname);
                }
                include_once 
XOOPS_ROOT_PATH.'/class/uploader.php';
                
$uploader = new XoopsMediaUploader($dirname, array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png'), $options['maxsize']*1024$options['maxwidth'], $options['maxheight']);
                if (
$uploader->fetchMedia($_POST['xoops_upload_file'][$index])) {
                  
                    
$uploader->setPrefix('image');
                    if (
$uploader->upload()) {
                        @
unlink($dirname."/".$oldvalue);
                        return 
$uploader->getSavedFileName();
                    }
                    else {
                        echo 
$uploader->getErrors();
                        return 
$oldvalue;
                    }
                }
                else {
                    echo 
$uploader->getErrors();
                    return 
$oldvalue;
                }
                break;
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1322
wishcraft
Re: SmartProfile - edituser.php & /admin/user.php

Ok the second bug i have a quick fix for it...

from line 53 to line 81 of /smartprofile/include/functions.php should be as follows:

global $op_buffer;
    
$member_handler =& xoops_gethandler('member');
    
$display_criteria = new Criteria('uname'$user->getVar('uname'));
    if (
$user->getVar('uid') > 0) {
        
//existing user, so let's keep the user's own row out of this
        
$display_criteria = new CriteriaCompo($display_criteria);

        
$useriddisplay_criteria = new Criteria('uid'$user->getVar('uid'), '!=');

        
$display_criteria->add($useriddisplay_criteria);
    }
    
$display_count $member_handler->getUserCount($display_criteria);
    unset(
$display_criteria);
    if (
$display_count 0&&$op_buffer!='edit') {
        
$stop .= _PROFILE_MA_DISPLAYNAMETAKEN."";
    }
    if ( 
$user->getVar('email')) {
        
$count_criteria = new Criteria('email'$user->getVar('email'));
        if (
$user->getVar('uid') > 0) {
            
//existing user, so let's keep the user's own row out of this
            
$count_criteria = new CriteriaCompo($count_criteria);
            
$count_criteria->add(new Criteria('uid'$user->getVar('uid'), '!='));
        }
        
$count $member_handler->getUserCount($count_criteria);
        unset(
$count_criteria);
        if ( 
$count &&$op_buffer!='edit') {
            
$stop .= _PROFILE_MA_EMAILTAKEN."";
        }
    }


and you will need to add these to lines to /smartprofile/admin/user.php at line 42

global $op_buffer;
$op_buffer $op;


that will fix the second bug... but is wrong with the first problem and uploading??
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1323
wishcraft
SmartProfile - edituser.php & /admin/user.php

Hi all how have you been, I am just trying to debug something with smartprofile module for a client that has been a pleasure doing business with.

Quote:

When I try to edit the profile from smart profile here /modules/smartprofile/edituser.php After saving I get the following errors.

Errors Returned While Uploading
Filename Is Empty
Errors Returned While Uploading
Filename Is Empty


I have checked where the error is coming from which is the uploader.php class as part of xoops, this is the source wrap that handles uploads for some reason the media name is coming through blank and it is erroring at line 198 of /class/uploader.php

if ($this->mediaName == '') {
            
$this->setErrors('Filename Is Empty');
            return 
false;
        }


I would say there is nothing wrong with the uploader class something ether to do with magic quotes and uploading on his service or a bug in smartprofile, just wondering if anyone knowns of a fix for this.

The other bug is a repeat of the last with the following error occurring when:

Quote:

When I try to edit from /modules/smartprofile/admin/user.php I get the following errors

ERROR: Displayname taken.
ERROR: Email address already registered.


But i will have a look and see if I can see what is doing that.. admin panel stuff is easier
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1324
wishcraft
Re: Hack the "recent comment block"

In /modules/system/templates/blocks you will find a smarty template called system_block_comments.html I think this is the one you need to alter, you will have to check the variable names in the PHP file that generates this, but this is the block i think that does 'recent comments' (don't quote me on this).

All you should have to do is make the block look and feel the way you want it and then refresh the module and clear your template_c path.

Thanks!
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1325
wishcraft
Re: SSL Encryption

How are you seolio, yeah I have set up a few SSL domains on XOOPS have a look at this one https://www.paythem.biz/ this is my payment gateway, I put together to bill my website from. Your welcome to sign up to intabill.com

Merchant Signup Page: https://join.intagate.com/join.php?type=merchant&mid=43f48496-85f2-102a-ba7a-00188b306089

Reseller Signup Page: https://join.intagate.com/join.php?type=reseller&mid=43f48496-85f2-102a-ba7a-00188b306089

and I can change the merchant ID you are billing from and you will get the cash..

Anyway more on SSL; basically there is only a few changes you need to make to ensure secure SSL, the XOOPS_URL define in main.php needs to change, ie:

define('XOOPS_URL', 'http://www.paythem.biz');

to

define('XOOPS_URL', 'https://www.paythem.biz');

And there is a couple of changes you need to make to the theme as well, some themes use the xoAppURL and xoImgURL smarty functions, these do not support the URL https:// they will always resolve to http:// which means you will have to modify the theme, do use <{$xoops_url}> and the theme name variable which is this extension in smarty tags:

<{assign var=theme_name value=$xoTheme->folderName}>

this will give you the variable <{$theme_name}> for the folder name of the theme.

Have fun!!
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1326
wishcraft
Page Descriptions & Keyword Density - SEO Tip #3

Well have you searched for your site, you will notice a lot of the pages have the same description, this means you are limiting the amount of possible keywords your search is going to be found on.

For the module writers there are a few steps to ensure that this isn't a problem, introduce a field called a Teaser and use this to populate the smarty variable xoops_meta_description this allows the user to populate a description that they want to be searched under, it only has to be around 128-250 chars a varchar will do.

The other alternative is to turn on an off and on the tag itself this is using a system of smarty if, for example in your theme you will have a line that looks like:

<meta name="description" content="<{$xoops_meta_description}>" />


You would want to change it to be contained within an if clause that is fired by your tpl variable in the modules you want the description left in..

For example, in your theme you would replace this with:

<{if $dontallow_meta_description==0}>
<
meta name="description" content="<{$xoops_meta_description}>" />
<{/if}>


now in the php files where you want the page content to be searchable by the search engines and display in the searching matrix you would add the following $tpl call.

$xoopsTpl->assign('dontallow_meta_description'true);


This will turn off the description tag and the search engines will use the page content or where the common keywords in the search term are found on the page.

Alternatively the teaser option allows for the description to be UGC but this only really applies to individual content pages and you can still turning off the meta description on pages that contains a listing not an individual item.

Now to implement the teasers you will have to do a call in your php file (which i think most of you will know this) as something like:

$xoopsTpl->assign('xoops_meta_description'$data['teaser']);


This will alter the smarty variable and allow for the description to be called what the User Generated Content reflects or have some finite data for the search engine to place on that page rather than the default description.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1327
wishcraft
Re: Page Titles and Meta Keywords - SEO Tip #2

yeah your right about that minor error in the meta_keywords function to the standard xoops_meta_keywords sorry I copied the code from the multixoops I put together for my SEO experiment in XOOPS and escorting websites I hacked together from 2.0.13 - 2.0.16; which has a few extra and amendments to it.

Umm with the second version of the code you shouldn't have repeats in the keywords as it has this clause:

$pg_array = array_unique($pg_array);

array_unique will strip duplicates from the array then implode it back to a string with the implode function. yeah I found that in the first version of the code that there where duplicates so I decided to implement array_unique which will strip out duplicates.

This changes the keyword density of the the site so your pages don't have the same keywords on every page and every search engine goes, 'well thats keyword stuffing' at least this is what I am told it is called or one of the versions of that is called, and marks you down a bit.

ps. Thanks for the invite
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1328
wishcraft
Re: Page Titles and Meta Keywords - SEO Tip #2

a better version of this code is:

<meta name="keywords" content="<{php}>$pg_title = $this->_tpl_vars['xoops_pagetitle'].','.$this->_tpl_vars['xoops_sitename'];
    
$pg_title = str_replace(' ',',',$pg_title);
    
$pg_title = str_replace('-',',',$pg_title);
    
$pg_title = str_replace('|',',',$pg_title);
    
$pg_title = str_replace(':',',',$pg_title);
    
$pg_title = str_replace('=',',',$pg_title);
    
$pg_title = str_replace('&',',',$pg_title);
    
$pg_title = str_replace(')','',$pg_title);
    
$pg_title = str_replace('(','',$pg_title);
    
$pg_title = str_replace('[','',$pg_title);
    
$pg_title = str_replace(']','',$pg_title);
    
$pg_title = str_replace('{','',$pg_title);
    
$pg_title = str_replace('}','',$pg_title);
    
$pg_title = str_replace(' and ',',',$pg_title);
    
$pg_title = str_replace(' the ',',',$pg_title);
    
$pg_title = str_replace(',,',',',$pg_title);
    
$pg_title = str_replace(',,',',',$pg_title);
    
$pg_title = str_replace(',,',',',$pg_title);
    
$pg_title .= ",".$this->_tpl_vars['meta_keywords'];
    
$pg_array = explode(",",$pg_title);
    
$pg_array = array_unique($pg_array);
    echo implode("
,",$pg_array);<{/php}>" />
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1329
wishcraft
Title element in <a> tag - SEO Tip #1

Quote:
what about using the title tag ? will it have the same result as the name tag ?


The name tag is to assign an object class or naming class to a group of tags, you can also populate the title tag but you want to be careful of keyword density (see SEO Tip #2 for ways of fixing this).

See what a name does is assign a group of text an association of an object much the same way you have a class in PHP which is a group of functions.

The name when you put it into a tag will assign it to an object rather than being some vagrant link on a page, this will provide reciprocal linking to the same anchor without a href element in it.

From my quick research and there isn't much on this if you populate the title tag

ie:

<a href="<{$array.link}>" name="<{$array.title}>" title="<{$array.title}>"><{$array.title}><a>


The title will be used similarly to a meta keyword with a lower percentile score against it.. But this is something I will have to experiment with.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts



1330
wishcraft
Re: Link Anchorage for better SEO Scores - SEO Tip #1

OK I have put a warning in and I will change my signature...

Oh come on it is just an experiment to see if you can top XOOPS in the SEO on adult content..

Later
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts




TopTop
« 1 ... 130 131 132 (133) 134 135 »



Login

Who's Online

191 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jul 31
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Latest GitHub Commits