11
Peekay
Extgallery. Force photo title and upload
  • 2016/11/24 9:48

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I have been doing some work with Extgallery recently and found that the module will automatically use the filename if no photo title is entered. This is useful, but if you want to force users to enter a title you can change the following.

In public_upload.php at about line 68, simply change FALSE at the end of the line to TRUE (as shown) and the Xoops form feature will make the field required.

// pk make photo title a required field (set TRUE)
$form->addElement(new XoopsFormText(_MD_EXTGALLERY_PHOTO_TITLE'photo_title''50''150'),true);


It's a good idea to make uploading a photo a requirement, so you can make the change again just below at around line 74:

// pk make uploading a photo a requirement
$form->addElement(new XoopsFormFile(_MD_EXTGALLERY_PHOTO'photo_file'$xoopsModuleConfig['max_photosize']),true);


The second change might be a better default IMHO.

PK



12
Peekay
Re: How to turn off Advanced registration form?
  • 2016/11/23 17:25

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


For anyone new to the Profile module (me included) to force the multi-step registration you need to open the 'Registration Steps' screen in the module admin and click on the green tick in the 'Save after step' column in the 'Basic' row to turn it into a red cross. Otherwise, the validation email will be sent once the first form is completed, even if the person abandons the second 'advanced' form without completing any of it.



13
Peekay
Extgallery. Add upload button to index page
  • 2016/11/18 12:01

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I recently read a question asking if the 'upload' and 'user album' links could be added to the main page of Extgallery instead of it being visible only in the main menu block. I had a requirement to do this myself recently, so I hope this may help someone else. It's pretty easy (this is for Extgallery version 1.11 updated by Zoullou + Xoops 2.5.5). Obviously, create backups first.

Firstly, in 'extgallery/index.php' add the following, before the footer include line:


// pk add upload and view-my-album links to main page

if(isset($GLOBALS['xoopsModule']) && $GLOBALS['xoopsModule']->getVar('dirname') == "extgallery") {

    if(
$GLOBALS['xoopsUser'] != null) {
        
$albumlinkname _MD_EXTGALLERY_USERALBUM;
        
$albumurl "public-useralbum.php?id=".$GLOBALS['xoopsUser']->uid();
    }

    include_once 
XOOPS_ROOT_PATH.'/modules/extgallery/class/publicPerm.php';

    
$permHandler ExtgalleryPublicPermHandler::getHandler();
    if(
count($permHandler->getAuthorizedPublicCat($GLOBALS['xoopsUser'], 'public_upload')) > 0) {
        
$uploadlinkname _MD_EXTGALLERY_PUBLIC_UPLOAD;
        if(
$GLOBALS['xoopsModuleConfig']['use_extended_upload'] == 'html') {
         
$uploadurl "public-upload.php";
        } else {
         
$uploadurl "public-upload-extended.php";
        }
    }
}

$xoopsTpl->assign('albumlinkname'$albumlinkname);
$xoopsTpl->assign('albumurl'$albumurl);
$xoopsTpl->assign('uploadlinkname'$uploadlinkname);
$xoopsTpl->assign('uploadurl'$uploadurl);

// end pk mod


Next, add the links to 'templates\extgallery_index.html'. You can style these links as required, or turn them into buttons.

<div>
         <
a title="<{$albumlinkname}>" href="<{xoAppUrl modules/extgallery/}><{$albumurl}>"><{$albumlinkname}></a> <br />
         <
a title="<{$uploadlinkname}>" href="<{xoAppUrl modules/extgallery/}><{$uploadurl}>"><{$uploadlinkname}></a>

     </
div>


Finally, add a new language definition to 'language\english\main.php':

// pk add my user def for new album link
define("_MD_EXTGALLERY_USERALBUM","View my album");


HTH



14
Peekay
Re: Google Maps API Keys are back
  • 2016/9/12 17:44

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


**EDIT

Sorry, missed out a step in the above.

You will during the process of getting a new key be asked to choose an API. The one you want is 'Google Maps JavaScript API'.

You can access all the APIs from the 'Library' menu option in the left sidebar.

Peekay



15
Peekay
Google Maps API Keys are back
  • 2016/9/12 14:51

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Google Maps API Keys are back

To embed Google Maps in a website, webmasters had to register for a free 'API Key' on the Google developers website. Then, Google changed the rules and for a while you could embed maps without a key. Now, from June 2016, API keys are back.

To get keys for your domains that use a Google maps module (you need one for each domain AFAIK) go to:

https://console.developers.google.com

Log in with your Google account credentials. In the API Manager screen - to the right of the Google API logo - you will see a drop-down menu of API projects. If you had registered a key sometime in the distant past, you may find that you already have a project called 'API Project' which is the name given to legacy keys.

Getting a new key

Getting a new key is a two step process. First, you need to create a new project/key combination. To do this, select the aforementioned drop-down menu, choose 'Create Project' then follow the prompts. At some point a window will appear with the key which you can copy. You will need to paste it into a module preference field, or hard-code it into the URL that calls Google Maps.

Step two is to register your site domain with Google. To do this:

* Ensure the correct project is selected in the drop-down menu.
* Select the 'Credentials' option in the left sidebar.
* Click once on the key (the default name is 'Browser key').
* Under the section 'Accept requests from these HTTP referers' do the following:

1) In the empty field, enter the word

Quote:
'localhost'

and press 'Save' (this enables localhost map development)

2) In the new empty field that then appears, enter the actual site URL including the wildcards, e.g.

Quote:
*.mywebsite.co.uk/*

It can take a few minutes for the changes to take effect.

Code changes

There have also been some changes to the way Google maps is accessed. Most importantly, you will need to change the primary script source URL from:

Quote:
http://maps.google.com/maps?file=api&v=2&key=.....

to:
Quote:
//maps.googleapis.com/maps/api/js?key=.....

Some of the syntax has also changed, e.g.

Quote:
GMap2 changes to google.maps.Map

Quote:
GLatLng changes to google.maps.LatLng

There are more replacement pairs listed on the Google developers website, but these seem to be the significant ones. You may also need to remove some references to deprecated classes to prevent Javascript console errors. Running Firebug in Firefox will display errors from Google if their map API is unhappy about something.

For example, the addControl() method is deprecated, so in the module that I use I had to comment out:

Quote:
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());

The default map controls are now enabled by default, so map navigation wasn't affected.

There's a good guide to implementing the update at:

https://developers.google.com/maps/articles/v2tov3

HTH */



16
Peekay
Re: Template of search.php ??
  • 2016/2/24 9:23

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


... and some more. I should point out that I am using Xoops 2.5.5 so the CSS identifiers may have changed in later versions.


/* heading */
form#search th {
padding10px 0 5px 0;
font-familyamblelight;
font-size30px;
font-weightnormal;
color#006600;
background-colortransparent;
}

form#search tr {
height45px;
}

/* caption */
form#search .caption-text {
colorblack;
margin-right1px
}
/* caption marker e.g. asterisk */
form#search .caption-marker {
colorred;
margin-right2px
}



17
Peekay
Re: Template of search.php ??
  • 2016/2/24 9:02

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


This is my search CSS. Obviously the values may not apply to your theme, but it shows the targets. A height and width setting for the checkbox input may change the box size, although I haven't tried it.

/* pk ---------- Search (table) -------------- */

form#search{
  
displayblock;
  
width90%
}

form#search input[type="checkbox"] {
floatleft;
line-height1.5;
margin4px 0 4px 0;
}

/* pk checkbox label */
form#search label {
  
floatleft;
  
margin0 10px 0 10px
}

form#search select{
width100%;
height35px
}

form#search input[type="button"], input[type="submit"]{
margin5px 0 0 0;
}

form#search input[type="text"] {
width100%
}



18
Peekay
Re: Template of search.php ??
  • 2016/2/23 16:30

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I have been working with the xbootstrap theme recently and it is really good, however the checkboxes for selecting modules on the 'search results' page (and everywhere else for that matter) are presented in a horizontal line. The line doesn't break when the page is viewed on a mobile phone, so I hacked the code to display checkboxes underneath each other.

This is bad practice, invalid HTML and of course it affects every checkbox array on the site... but it makes the boxes easy to select on a phone and they don't break out of the viewport.


/class/xoopsform/formcheckbox.php

Around line 208

Change:

$ret .= $ele_extra ' />'."<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" $name "</label>" $ele_delimeter ;


to:

$ret .= $ele_extra ' />'."<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" $name "</label><br clear='all' />" ;



19
Peekay
Re: imagemanager image sort order
  • 2016/1/20 12:54

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


The lack of any sort order in the TinyMCE image-manager plugin has bugged me for years, but I have just lived with it.... until now!

Quote:
class\xoopseditor\tinymce\tinymce\jscripts\tiny_mce\plugins\xoopsimagemanager\xoopsimagebrowser.php


Added the above fix at around line 470.

It is a little late (6 years) but many thanks elpaksu



20
Peekay
Re: Random Quotes
  • 2013/6/27 10:27

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


That is completely unacceptable. Very disappointing to see this kind of response. You should discuss this with your other moderators.




TopTop
« 1 (2) 3 4 5 ... 187 »



Login

Who's Online

100 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 100


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits