I installed zen-cart on my website. But when i insert the image in admin panel, i found the image link broken. Need Help.
My code
<?php define('HTTP_SERVER', 'http:/');
define('HTTP_CATALOG_SERVER', 'http://****');
define('HTTPS_CATALOG_SERVER', 'https://**');
define('ENABLE_SSL_CATALOG', 'true');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_FS_CATALOG', '/home/**/public_html/');
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_CHARSET', 'utf8');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', );
define('DB_SERVER_PASSWORD', );
define('DB_DATABASE', );
define('SQL_CACHE_METHOD', 'none');
Check DIR_WS_IMAGES and DIR_WS_UPLOADS in includes/configure.php and and DIR_WS_CATALOG_IMAGES in admin/includes/configure.php. You want these values to be consistent. Also check in admin/includes/configure.php the value DIR_FS_CATALOG_IMAGES.
Related
In https://www.mediawiki.org/wiki/Extension:TinyMCE, there a section with Toolbar buttons including a Citation/reference button which looks like this:
Furthermore, it says: "Depending on configuration, some or all of these buttons may be shown".
It is not clear however how to enable/disable specific buttons in LocalSettings.php.
In the https://www.mediawiki.org/wiki/Extension:TinyMCE/Configuration page, there are instructions on how to add buttons to toolbars, and based on that I have added this to my LocalSettings.php:
wfLoadExtension( "TinyMCE" );
$wgTinyMCEEnabled = true;
$wgTinyMCESettings = [
".tox-tinymce" => [
"toolbar+" => " | citation",
],
];
.tox-tinymce being the selector for the text box where TinyMCE applies.
The citation button does not appear currently, and before I debug, I'd like to know (1) if I am on the right track, and (2) how can i know the machine name of a button (I assume it's citation, but maybe it's "footnote" or "cite", it is not clear where to find the mapping of machine names to buttons).
I have gone through the mediawiki-extensions-TinyMCE-master
Inside custom plugin directory mediawiki/plugins I saw 12 custom plugins.
I have opened one by one plugin code I observed only 3 plugins wikitext, wikitoggle , wikiupload are loaded in tinymce plugin manager. Ex:-
tinymce.PluginManager.add('wikitoggle', wikitoggle);
I could enable these buttons directly in load-extensions.php.
wfLoadExtension( "TinyMCE" );
$wgTinyMCEEnabled = true;
$wgTinyMCESettings = [
"#wpTextbox1" => [
"toolbar" => 'wikitext wikitoggle wikiupload',
],
];
I saw wikireference code at the end it has plugin function defination.
function Plugin () {
// only load plugin if the 'cite' extension is enabled
// in the wiki, eg, if 'ref' tag is in extension tag list
if ( extensionTagsList.split('|').indexOf('ref') > -1 ) {
pluginManager.add('wikireference', function (editor) {
registerCommands( editor );
registerButtons( editor );
setup( editor );
});
}
}
Plugin();
// only load plugin if the 'cite' extension is enabled
// in the wiki, eg, if 'ref' tag is in extension tag list
from the plugin method comments I could figure it out how to load reference and comment buttons.
first we need to download and install Cite extension plugin
echo 'Downloading and installing Cite'
echo 'See https://www.mediawiki.org/wiki/Extension:Cite#Installation'
curl -O -L https://github.com/wikimedia/mediawiki-extensions-Cite/archive/refs/heads/master.zip
unzip master.zip
rm master.zip
mv mediawiki-extensions-Cite-master extensions/Cite
Enable reference and comment button in load-extensions.php
[
"toolbar" => 'reference comment',
],
];
if I add a custom filter jwt to shiroFilterFactoryBean, the urlFilter.put("/helloworld","authc,rolse[user]"); is
Invalid.
Map<String,Filter> filterMap = new LinkedHashMap<>();
filterMap.put("jwt",new JWTFilter() );
shiroFilterFactoryBean.setFilters(filterMap);
Map<String,String> urlFilter = new LinkedHashMap<>();
urlFilter.put("/user/signin", "anon" );
urlFilter.put("/user/register", "anon" );
urlFilter.put("/**", "jwt" );
urlFilter.put("/helloworld", "authc,rolse[user]");
Order matters, you just need to stick the /** at the end of your map, see related warning in the documentation:
https://shiro.apache.org/web.html#web-ini-configuration
So I am using Kevin Hill's excellent PHP wrapper for Google Charts, 'LavaCharts' and am following his guide on how to access the image URI of each (I need to output the charts in an image format so that I can export the page as a PDF).
https://github.com/kevinkhill/lavacharts/wiki/Getting-a-chart-as-an-image-3.0.x
I am getting the following error: 'getImageCallBack is not defined'
I am registering the 'getImageCallBack' event on each chart from the Controller:
\Lava::PieChart('TotalCallsReceived', $totalCallsReceived, [
'events' => ['ready' => 'getImageCallBack'],
'title' => 'Total Calls Received & Transferred',
'is3D' => false,
]);
And then in the head of my page I have the following. (I will figure out what to do with the URI once I've solved this error. For now logging it is fine)
<script type="text/javascript">
function getImageCallback(event, chart) {
console.log(chart.getImageURI());
// This will return in the form of "data:image/png;base64,iVBORw0KGgoAAAAUA..."
}
</script>
Has anybody else overcome this problem?
the function names are different and need to match case...
the "B" is capitalized here...
'events' => ['ready' => 'getImageCallBack'],
and not here...
function getImageCallback(event, chart) {
I m trying to setup magento live site to local system. I also gone through various forum, and tried all suggested solution but still I m not able to enter admin section.
I have modified the varian.php file as suggested, cleared the cache files under var and purged my browser but still can not log in to admin panel. It gives the following url
http://praveen.linuxstagedb.com/poppyshop/index.php/spsitemanager/dashboard/index/key/4d80fdfbf3d9f40ab36ac79a25fb12ab/
Note - spsitemanager used for admin.
Can anyone help please?
Thanks
Praveen Shukla
Remove the code that you have commented in that file and paste the below code in the same area.
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}
I am building an Facebook IFrame App. I am using the below javascript code to request user to login and allow permissions for the application, after which they are supposed to be redirected to the iframe app. The code works correctly. But, I have two issues with it.
a. as soon as the app loads in IFrame, it redirects to a page (http://www.facebook.com/connect/uiserver.php?app_id=......) and displays a large facebook icon. When I click this icon it redirects to facebook login page. I want my app to redirect to the login page directly instead of showing the inbetween facebook icon page.
b. When the user clicks 'Allow' button for the requested permission in facebook, the page redirects to my main site (http://www.mysite.com) instead of the iframe application(http://apps.facebook.com/myapp).
I have pasted my javascript below, this works with above quirks.
var api_key = 'xxxxxxxxxxxxxxx';
var channel_path = 'xd_receiver.htm';
FB_RequireFeatures(["Api"], function () {
FB.Facebook.init(api_key, channel_path);
var api = FB.Facebook.apiClient;
// require user to login
api.requireLogin(function (exception) {
FB.Connect.showPermissionDialog("publish_stream");
});
});
Help much appreciated.
I have remembered something!
You must use target="_top" in all your links and redirections in a iframe application!
Hope I help you.
Thanks for your answers.
I used the solution posted by McKAMEY(Facebook API: FB.Connect.requireSession issues) with few changes, and it works as intended, without showing the intermediate facebook icon page, and also it redirects after authentication to the iframe app correctly.
I have posted below the working solution in case someone needs it.
var api_key = 'xxxxxxxxxxxx';
var channel_path = './xd_receiver.htm';
var canvas_url = "http://apps.facebook.com/myappxxxx/"// ensure your canvasurl has a '/' at the end!
function Initialize() {
FB_RequireFeatures(["Api"], function () {
FB.Facebook.init(api_key, channel_path);
FB.ensureInit(function () {
FB.Connect.ifUserConnected(
function () {
var uid = FB.Connect.get_loggedInUser();
if (!uid) {
authRedirect();
return;
}
},
authRedirect);
});
});
}
function authRedirect() {
//This is the Sample URL Structure for redirecting to facebook
//http://www.facebook.com/connect/uiserver.php?
//app_id=XXXXXXXXXXXXX&
//next=xxxxxxxxxx_success_url_here_XXXXXXX&
//display=page&
//perms=XXXXXX_comma_seperated_permissions_list_hereXXXXXX&
//fbconnect=1&
//method=permissions.request
window.top.location.href = "http://www.facebook.com/connect/uiserver.php?app_id=" + encodeURIComponent(api_key) + "&next=" + encodeURIComponent(canvas_url) + "&display=page&perms=publish_stream&fbconnect=1&method=permissions.request";
}
Initialize();
Note on redirecting within a frame to the Facebook login page. You have to use javascript to redirect the entire page since the login page passed the X-Frame-Options:DENY header and modern browsers will prevent you from sending the user to the URL if that header is present. Solution is to use javascript::window.top.location = ''; to redirect the whole page
I'm not sure on the middle page between redirection but what does your apps canvas and connect url point to?
The redirection after login should go to that page unless you have this overridden somewhere in your code.
Change the urls in the settings on fb to apps.facebook.com/myapp if that's not what its set to.
You may use the new Facebook Graph API (http://developers.facebook.com/docs/api) to handle authentication. First, you must check if you have the access_token:
$access_token = $_REQUEST['access_token'];
if($access_token != NULL) {
...
}
else {
// the following javascript
}
And the javascript is:
<script type="text/javascript">
top.location.href = '<?= "https://graph.facebook.com/oauth/authorize?client_id=".$appid."&redirect_uri=".$appurl."oauth_redirect" ?>'
</script>
You must have a file oauth_redirect.php like this:
<?php
$code=$_REQUEST['code'];
$url = "http://graph.facebook.com/oauth/access_token?client_id=".$appid."&redirect_uri=".$appurl."oauth_redirect&client_secret=".$appsecret."&code=$code";
$curl = curl_init();
// SET URL FOR THE POST FORM LOGIN
curl_setopt($curl, CURLOPT_URL,$url);
curl_setopt($curl, CUPROPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CUPROPT_SSL_VERIFYHOST, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($curl, CURLOPT_HEADER ,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER ,1);
// EXECUTE 1st REQUEST (LOGIN)
$response = curl_exec ($curl);
?>
<script type="text/javascript">
top.location.href = '<?= $appurl."?".$response ?>';
</script>
Finally, you can return to your index page (the $appurl variable) and test if the user has permission testing access_token presence.
Hope it helps!