How To Change target paths for thousands of products at once - magento-1.7

I am using Magento 1.7.1 and find that magento has automatically added ugly urls like www.afd.com/catalog/product/view/id/2728/name.html.
When I go into catalog > URL Rewrite, I see the target paths for all my products listed in the above totally unfriendly way with id numbers displaying.
How do I fix this en masse?
Thanks.
-TM

Try to do it by using a .csv file. You can create a php file which will run outside your project and do the expected changes via a csv file. Also hopes this will help to grab an idea. http://www.solvingmagento.com/magento-url-rewrites/

Refresh all indexes in magento, here is instrucion http://www.inmotionhosting.com/support/edu/magento/102-customizing-magento/how-to-reindex-your-magento-website, then flush all cache. Then magento should use Url Rewrites. If doesn't work make sure that you heve proper settings in
System->Configuration->Web->Search Engine Optimization

Related

Howto to configure TCA settings and save them globaly

I'm configuring a new website with TYPO3 v. 9.5.
I would like to configure TCA settings to make it possible to force editors to fill fields in content elements like media or news.
In former times I was able to put this settings into a file typo3conf/extTables.php.
In my investigations I found, that I have to put configurations into a directory Configuration/TCA/Overrides of an extension.
I tested it with the extension tx_news like this:
I put this code in a file called test.php as a test and example.
This code forces the editor to always enter an archive date.
This works for me, but after an extension update, this code might be lost and I cannot configure the fields of core extensions for example to force an editor to always enter a title of a content element.
My question is, how can I store this configurations update save within the configuration environment?
Thank you in advance,
Ralf
Depending on your modifications you need to consider some aspects:
always use a filename according to the table your modifications belong.
so for the news records it should be: Configuration/TCA/Overrides/tx_news_domain_model_news.php
make sure your modifications are loaded after the first initial configuration: make a dependency to the original extension.

How do I edit files in place that were uploaded to Moodle?

I would like a better workflow for debugging uploaded SCOs. As things are, I must edit a file in the activity, repackage, upload, and test. Often, I just need to change a single line of code. It would be VERY nice to be able to edit that file, that line of code, on the server. So far, all I've found is that Moodle manages the files, so it seems impractical to locate and decipher the renamed files after upload.
Is there a way to configure Moodle so that it doesn't rename and relocated files in SCOs upon extraction? Actually, I'm open to any suggestions on the best, fastest workflow for debugging SCOs.
Problem background
Since Moodle 2.0, files are no longer stored on server in the conventional /this/is/the/path/to/my.file way. Instead, files are rehashed and stored in Repositories (i.e. spread all over the moodledata folder as a collection of seemingly random data). This increases security and cross-OS compatibility but complicates stuff for people who would like to simply upload a SCORM zip package via FTP. Here's more information on file handling in Moodle 2.0
Path to the soluton
Let's locate the file you want to update, then update it.
Run phpmyadmin, go to mdl_files table, find your file by name in the filename field (let's say it's portrait.jpg)
Look at the contenthash field, it'll look like abcde1234567890. This means your file is stored in moodledata/filedir/ab/cd/ folder under the name abcde1234567890.
Rename the updated portrait.jpg to abcde1234567890, upload and overwrite.
Go back to phpmyadmin and update the filesize field in record for portrait.jpg with the size of the updated file.
Obviously, this process can be automated. You'll have to write a script that allows you to upload a file, then it'll search for that file in mdl_files, save it to the correct folder and update all fields accordingly.
Alternative idea
Enable external package type (and also enable 'Update on every launch'). Go to Site administration / Plugins / Activities / SCORM and check the box down below. Now you'll be able to launch SCORM packages directly from another server, so Moodle won't mess with it. Of course, you can run in other (probably cross-domain related) problems.
Sergey's answer is very good, with one caveat:
In his example with the contenthash of abcde1234567890, the file is stored in the moodledata/filedir/ab/cd/ folder under the name abcde1234567890. Moodle uses the full contenthash to name the file.

Show license agreement before download

I have to solve the following task for our university homepage:
Whenever a pdf is requested the user has to accept a license, which pops up.
On Agree the download starts. If not, no download is possible.
I searched through the extensions but did not find any extension doing the job. Maybe you know one...
So I tried to implement my own extension. Taking the strengths of securelinks (Allows access control to files from a configurable directory ... presents a license acceptation prior to download) and naw_securedl ("Secure Download": Apply TYPO3 access rights to ALL file assets (PDFs, TGZs or JPGs etc. - configurable) - protect them from direct access.) I wanted to combine both extensions to have one that:
whenever a pdf file is requested (naw_securedl)
a license is shown and in case of ACCEPT a redirect to the file happens (securelinks).
This task sounds very easy, since I only have to combine both tasks. Anyway, I failed.
How do you solve this problem?
Do you know some extension doing the job?
Is anyone interested in a cooperation in which we try to create an extension thats doing the job?
Thanks for your help in advance!
Assuming that all donwloads are stored in one folder, I'd recommend writing your own little extension that replaces every link with a link to an intermediate site, like this:
www.mydomain.com/acceptlicense.html?downloadfile=myhighqualitycontent.pdf.
On the accept license page, users need to check the accept license checkbox, then click a submit button, which leads them to the download page, still carrying the GET parameter:
www.mydomain.com/download.html?downloadfile=myhighqualitycontent.pdf.
If not all files are in the same folder, you can replace slashes in the file path with other characters (they need to work in the URL). Or you might need a database table that indexes the files, so you can use IDs for the download files:
www.mydomain.com/acceptlicense.html?downloadfileID=99
If you don't know at all how to write TYPO3 extensions, consider using individual php/html files out of the TYPO3 context.

Zend Framework Bootstrap with Layout?

So, I have a problem and I have been searching forever about how to do this.
I want to have several project directories on my shared host but I want to be able to hit the public directory when someone types in the root directory for that project. I can't edit the httpd.conf to set up virtual hosts so I have been looking for alternative solutions.
Account Structure
/public_html
.../Project1
....../application
....../public
I stumbled on http://www.mauriciocuenca.com/blog/2009/03/two-or-more-zend-framework-projects-on-a-shared-host/ and followed the steps (modifying some stuff since it is outdated)
And I can get a single view to show up. The problem is, if I create a layout I can't get anything but the normal view to display. I think I am just missing a simple hook up.
Is the above solution the best for my situation?
You problem is not 100% clear, I can't figure out that you want to serve one site per shared host directory or all site from the same directory.
Although you can't edit httpd.conf, you can use .htaccess file. While using Zend you already use .htaccess (located in public dir). So you can write rules to make url based redirections.

Counting eclipse plugin installations/downloads

I'm currently hosting an Eclipse plugin update site on sourceforge.net . SF.net does not allow access to server logs but I'd still like to know how many downloads the plugin gets.
Is there an alternative way of gathering them?
I'm not going to have any sort of 'call home' feature in the plugin, so please don't suggest that.
I wrote a blog about how to track downloads of an Eclipse plug-in update site. What you can do is specify a url to your server and every time a download is initiated the update site will send an HTTP HEAD request to that url, which you can then use to count the number of times the plug-in was downloaded. If you want to track some information about who is downloading the plug-in you can pass information, like the package name, version, os, and and store it in a database.
http://programmingfortherestofus.blogspot.com/2014/08/tracking-downloads-to-your-eclipse.html
I hope it helps!
It is possible to host the plugin jars in the file release service, and then get your site.xml file to point to them. You need to point at a specific mirror to make it work.
This will tell you how many times people download each file as with a normal file release.
Unfortunately, in practice this is a lot of work to maintain, and tends to be unreliable (I kept getting bug reports saying the update site wasn't working).
You could write a very simple php script which just serves up the relevant file, and logs the download to a file or DB. Make sure it double checks the URL is a valid one to download to the user of course :)
Once that's in place, you can update the site.xml to point to the correct thing, or you could probably use URL rewriting to intercept requests to your jar file and pass them through the script. I've never tried that on the SF servers, but it might work.
EDIT:
Even better, just have a php script which sends a redirect like this:
<?php
$file = $_GET('file');
// Now log the access to file
header('Location: ' . $file);
?>
Just a thought: AFAIK, SourceForge does tell you how much data you served. You know the size of your plugin JARs. Divide the data served by the size of your plugin and you get a rough estimate of how many downloads you had.