|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////3 i5 l' _4 v% V& f# I7 C* _* ?
// Theme Option
! }" s- x1 Y8 L4 j2 o; m, w V9 H////////////////////////////////////////////////////////////////////////////////- p! ~% X, M7 d* q4 Y% D) O0 E
! e/ r5 l9 K) s6 S$themename = "Zenx";
% z) E. \% p: o! F: L$shortname = str_replace(' ', '_', strtolower($themename));9 Y& }! }) F/ X; Y9 h
- G! m) C- a a& W# afunction get_theme_option($option)# H; A% n( A" p: |9 ~
{; M( `5 E) W0 S' X! m+ o
global $shortname;
6 x/ M" }2 j! R' R return stripslashes(get_option($shortname . '_' . $option));. Q' Q4 n! o1 [" J' L( I
}6 x. m* W+ b. O' x1 R7 ]
6 O+ t. s) m8 o$ j% B) nfunction get_theme_settings($option)
( i4 a* s0 R3 P0 T) w{ f4 c* c o* H6 d
return stripslashes(get_option($option));/ T. F _* [" I, ?+ L. \6 D
}
( C& M& m2 k: N! X8 j$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");& z: Y' V9 ?+ P! i0 ^
$wp_getcat = array();/ c/ E& G8 H, Z/ L* B
foreach ($wp_dropdown_rd_admin as $category_list) {
) Y5 ?# l+ b \$ l; C$wp_getcat[$category_list->term_id] = $category_list->name;1 u$ c# x& b% E9 I- T
}. ^. H8 y- f3 H; L' X9 p
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");$ ?/ \# b) y. m, p) ~( _, q
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
& o9 r! ^; P. W$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
9 @( q! y3 \3 i7 ^
5 D5 l! r) ]& C$ g# @$options = array (
8 b8 T3 E. z4 O
7 z5 u& S' o* I2 \" G8 u& c: h6 g
1 s7 a5 B' m' w c. x array( "name" => "Blog Header Settings",; G' t, v6 P0 D/ K
"type" => "heading",
# w0 t/ Z. e! _% s3 @ a ),
, _' d4 C" { T, J/ ?8 G
; L2 B: E8 }; `$ o2 b) }/ ~3 g1 N array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>", L C9 m. H0 A+ ~: O
"id" => $shortname."_header_logo_activate",
3 u8 ` X% ~: ~9 [ "type" => "select",& S* _! k$ l$ q: T
"std" => "No"," ]3 _% r+ P% ]* x1 |4 k# k) H
"options" => array("No", "Yes")),1 x2 B: n, _+ U/ V4 k6 W
; p) L4 y; C/ k& a: A
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
8 G9 H( Z+ \% Z( l7 W "id" => $shortname."_logo_url",
# b+ N ^8 ~+ R5 s0 S3 p "type" => "text",6 K% j& q; u4 K( a; X4 s
"box" => "social",
0 s6 }( N, W$ a# j "std" => "",
S/ _" F1 u2 _. c ),: D: [! ^0 q) g. ^' B, p
! t" P, N, @& `' d% @* N array( "name" => "Insert Header Banner HTML Code (Header)
7 ]# k1 H5 j- X <br /><em>*Recommended Size 468 x 60</em>$ v0 g9 l2 `6 y1 w @
<br /><em>*leave blank if not use</em>",+ F5 |4 x/ }6 B. y: g3 v
"id" => $shortname."_header_banner",& E; u1 i6 p# `/ b# c* n" P
"type" => "textarea",# Z* J- J1 H6 J4 O" D- I
"std" => "",
0 C8 D5 Y9 U+ g6 F ),6 ?* l9 U* ]) i
6 C9 r0 H/ V! Y# S array( "name" => "</div></div>",
9 D/ @) A) M9 x- k "type" => "close",
! e7 y& g4 s* x; u# P# \! p& {( V1 o& ] ),0 a" X# U0 [* o" ~9 o% ~
, t% p! v3 X( u; v
/ w, J9 j- p* w) B3 o array( "name" => "Header Navigation Settings",
& N4 @' \- G' ]+ } "type" => "heading",, c. @9 T3 c/ H. n
),
" Y- {2 k8 T4 X0 _; E! s3 ?; _5 m1 N3 x1 J% C& E
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
$ _3 ?7 z$ @8 O! Y# [+ j5 M4 Z <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
3 q: [: \) ^ [2 d5 z, ]0 f8 F& ? <em>*Enter the page post ID number only</em><br /> ~$ Z4 e$ |3 b* e- C% U, i/ g
<em>*separate by comma</em><br />
9 e# g7 `/ N! b" X, n4 U <em>*Exclude pages which you don't want to show on the header navigation</em>",
( i+ W7 Q; q; f5 k, T: } "id" => $shortname."_header_page_navigation",8 N% S/ N4 {! h/ ]
"type" => "text",
' u: z5 H5 K( I "std" => "",
! B4 @( Z' v3 @* ~( i# S ),
' w1 ?# Y1 X; s- D+ `/ e- R, G& x/ ?( h; \7 I) p5 q
array( "name" => "</div></div>",
- P* F5 x: ~7 [: ~2 i "type" => "close",5 K# J# {5 G {2 D. K2 M/ K
),
7 d$ i s- M7 b( \7 L: L: U7 W
% W7 P( K! f9 g: |( e8 L: m" { [" m/ N7 r! S& G' K* D
array( "name" => "Post Auto Thumbnails Settings",& o6 z* S' H1 H% C P* U
"type" => "heading",
: M) B$ |. I* @2 ?7 O, L ),0 F4 p" x" |8 A- [. J
. y7 W; `7 X6 a+ O( F4 m$ \ array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( C5 ]; |- p3 t8 ]/ R) ~+ m
"id" => $shortname."_timthumb_activate",
$ K) d* A# c% _9 k. c0 i% C. p "type" => "select",' `# ~4 ?* q9 x+ k" g
"std" => "No",+ D- d- X5 X E# b+ f
"options" => array("No", "Yes")),3 L! |" J/ Z* ^% A
% A, e1 @, Y5 `, _3 E3 E4 U: h$ N
array( "name" => "If Timthumb is enabled, Please choose its cropping method",4 s4 @$ E/ V9 R2 k
"id" => $shortname."_timthumb_cropping",
+ g0 S8 }/ d& p; I5 M" O" H3 N "type" => "select",
* T C0 j: e; F2 S "std" => "",& L( V+ C8 G* }) z
"options" => $crop_position),1 `2 I1 {% G3 ]. V# E8 _& \* J$ O6 v
' E# |# A, E( h! }; F
array( "name" => "Insert Width Of Thumbnail Image<br /> u- F6 w6 G5 L& D; g8 p; r
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
* F& f' b/ F' M <em>*Leave Blank To Use Default: 250</em><br />",+ K. Z, m0 u/ W$ w; D, r b* @
"id" => $shortname."_thumb_width",2 F9 J! Z1 z: { ~
"type" => "text",
2 L+ x5 ^/ M$ o3 M. |" k "std" => "",
2 k8 K1 U0 V4 q6 q6 n ),
3 c0 d: W/ B; a9 \4 r! a" s4 m* Z1 m1 J! ]
array( "name" => "Insert Height Of Thumbnail Image<br /> h. D: Y- M, v8 R) G0 K) d
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
% z- Q2 N& [( P' L, n; f9 B <em>*Leave Blank To Use Default: 200</em><br />",3 L! r! M, J2 o2 p u
"id" => $shortname."_thumb_height",
* u( B1 u% _7 t2 k$ Q; Y( E "type" => "text",
) O7 z( W& w' |$ c' F/ Z "std" => "", G9 \+ @4 ~: E
),
2 D# Y3 J3 {) I. t6 s6 q; D, ?7 _+ J/ L9 a u- W
array( "name" => "</div></div>",5 R2 h+ Z! m* }' A
"type" => "close",7 l& j# F. n# b$ y! U+ Z; E! B
),+ \/ n1 D3 E& ?* n
. q9 X5 j/ e% j; g) E array( "name" => "Featured Content Slider Settings", T2 h7 d& c" h! U
"type" => "heading",3 y9 z& o8 t& h% {- x% q
),& m; ]5 H- V, @7 r6 z0 c* S7 ~( @
# h: X1 R: n& ~: E$ s; ]
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" X: V/ u2 P3 K( W "id" => $shortname."_featured_activate",
/ l) ]) @# C/ y: H. z2 h "type" => "select",4 R8 v# g7 g* X. }0 H
"std" => "No",
. T7 Z j8 n2 m: j0 [7 ?9 U9 q "options" => array("No", "Yes")),
. b& S# o0 ]! S# j7 }& [) j, S* L) y" p6 ?0 X
' g: o- t6 _( V6 X' c0 |7 o array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",# @% N, ?7 x& l5 [ u
"id" => $shortname."_featured_category",7 D' \7 ^0 b9 x( S/ M
"type" => "select",
+ E# G3 _; E2 o "std" => "Choose a category:", C4 p' }$ P1 J+ }
"options" => $wp_getcat),* l: W* y. }0 P8 I7 [
4 @: q3 H: @& S1 V$ {* a2 ?2 V& E array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",- ^& d1 d1 T$ {4 H0 c) w
"id" => $shortname."_featured_number",0 X2 Q6 P# a+ m7 [* y- `1 u
"type" => "select",
) a2 A0 o o+ P* l( Z J "std" => "Number of post:",
) W: G3 R% S% J0 { "options" => $number_entries),
5 r* a* u& L& ^! A- t9 ]6 I) M$ A% h. t0 E9 z$ t/ y
array( "name" => "</div></div>",. N% c! Z+ t. Q: y3 ^ @
"type" => "close",( o8 J0 ^9 X, V1 k, G& r3 T
),7 [( b8 l# p Z; W8 N/ T1 [: [, v+ F
1 J$ I' E" D/ k/ {( u0 F array( "name" => "Featured Category Settings",
0 k, u# o) e4 ~; g6 A "type" => "heading",
# K+ p# o _# K1 B; e" [3 } ),5 [# i3 k b, N- ^. Z: d
. }. N9 } D2 {" D' |, Q- k
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ f4 i& A5 |2 T8 t; k; s "id" => $shortname."_featured_category_activate",
) T) ^, X6 ^; H! o" u6 Z "type" => "select",. u) W1 g! u7 a; Q N
"std" => "No",
$ @' U! R3 K1 a. X& _ "options" => array("No", "Yes")),& b: q( ]* f7 _+ c( ?) n
- v* k- Y3 t2 I& l array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",% F6 A/ C% a3 J+ B- o) a% M% ^
"id" => $shortname."_featured_category_id1",4 R! D! m& |) I0 G6 @
"type" => "select",6 ?) Z7 H5 x5 O
"std" => "Choose a category:",. N3 V g0 `- b2 s2 A% y
"options" => $wp_getcat),' V: r. z# P( ?5 D' \; o- c1 {6 I: b
- O; G/ l; Q" q: M4 e array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",5 N0 @. O& |" S0 c: k( u# Q* P, ?
"id" => $shortname."_featured_number1",# V% \1 m0 g# H* \4 O9 N
"type" => "select",
. v T/ M: E3 w3 [" ]4 h# v" S' J "std" => "Number of post:",
- i/ t7 s' C0 D* B "options" => $number_entries),; i+ f4 G6 `2 S" B1 e: r# z* c
n1 n5 \* X" R6 S8 f array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
7 h3 j2 F. u# o$ g2 M/ k& z9 |" _ "id" => $shortname."_featured_category_id2",
* L6 F" m7 q' \& e9 ~& s; f6 n "type" => "select",2 o# B$ R& M' K: y: y
"std" => "Choose a category:",- b& d8 H: X+ _) L3 T8 c. W
"options" => $wp_getcat),1 b* Q0 M' ?! h
+ q! M4 Q8 d0 ~$ P- H8 V: |% x2 `
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
7 t7 w1 B! `. H* u- K% j$ ~ "id" => $shortname."_featured_number2",
% t+ [: x! b5 N/ r "type" => "select",; M, _' y' q9 Q6 X
"std" => "Number of post:",4 M8 M- U9 {$ E' T+ Q- m( e
"options" => $number_entries), n5 y# l' l1 b# V! [" A* ?! z$ J
& C7 j$ A: h4 o4 Z D+ Q" g* U$ ]
- z; {* [. S/ x$ X, ^4 R6 { array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",: J. x+ N) f) f; w5 Q
"id" => $shortname."_featured_category_id3",
# s2 @! z* W# r. [- G "type" => "select",
k1 W: }% R. j2 ]/ e "std" => "Choose a category:",7 V2 X9 W1 ], X% C1 b0 g: g+ ^% h
"options" => $wp_getcat),
& R& P: s) }+ V* V - @3 W [* q9 N/ u- `; d% R& G w
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
, A3 W% k/ ^; M) Z0 |# U9 N "id" => $shortname."_featured_number3",
$ R- X2 A+ @" j- Y3 O* c( @ B "type" => "select",
" @& i4 B) q; ]7 D "std" => "Number of post:",5 `( c0 B+ q4 F5 e% ]% Y) p
"options" => $number_entries),6 h" [. i. Y6 F' \" d
* H H* Q- @. z9 h s
9 {$ e% \6 b$ n" [7 M& _+ [ array( "name" => "</div></div>",5 U" X7 D, G/ i T
"type" => "close",
0 W: f% r" y& T, o ),
! s" u. N5 ^% T4 P# R+ A% | `0 d4 c5 u! r
1 g* \* }; R% ~ array( "name" => "Google Adsense & Analytics Settings",/ s, R8 \7 x8 L; M
"type" => "heading",
* O5 @( t: R- a# G: X ),' @& K" }7 I" q
! s) h( S) d$ A2 [# M% h% W array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",4 J/ o8 M. e7 d5 G2 n( w
"id" => $shortname."_adsense_loop_activate",; s, o* S1 x! @; N! h% f1 o
"type" => "select",
0 l' g& o, _: Y, L- b, K& F/ ? "std" => "Disable",
& Q! \% X; m' v- v) I% U "options" => array("Disable", "Enable")),( Y. y! q9 o7 U' w8 p
3 U) |# `1 v/ m array( "name" => "Insert Google Adsense Code For Loops Here<br />
/ U# O$ i" S3 y7 d0 I8 J7 ~ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; T/ W6 l9 h0 @# @# t "id" => $shortname."_adsense_loop",
6 R0 s1 h4 S/ n- W$ H! v5 B "type" => "textarea",
0 a6 T; v3 ?& ^0 p( [0 I2 o "std" => "",
" T- L0 z% Y$ C( W9 V/ l ),3 T% L1 V f6 O. t: [
- y4 B: A) {! _* P& f* S( T$ D array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",- @5 m) E6 G& I: H3 u
"id" => $shortname."_adsense_single_activate",/ {( Z$ l4 P k# i# p$ g
"type" => "select",
. y' t. t4 c! F& U' ^ "std" => "Disable",+ j* U/ _0 k% d* _( U. \
"options" => array("Disable", "Enable")),
, y! ?* r3 K8 U1 v* O2 G& y$ R8 h) q" ]( V" Y# G- S9 D* T( W: O
array( "name" => "Insert Google Adsense Code For Single Page Here<br />- ]5 r8 j" K1 ?
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
" w" f/ x4 G# c% b3 \6 q) y) v# Q8 H "id" => $shortname."_adsense_single",8 [+ a! H) _ `1 d7 d; E9 e( D6 C+ P
"type" => "textarea",
1 U0 R8 a3 t6 s/ p* b "std" => "",* z/ B1 S! ?$ E
),6 W1 B6 O) \: ?' [" Y. v; M6 u
+ `: v8 j: T/ l: L5 j+ X
+ w, n8 u1 X: z4 z
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
8 h$ d& Y7 N9 H4 v: |& P( Z C "id" => $shortname."_google_analytics",
0 c/ }/ e) o* e. t2 Q \' h "type" => "textarea",7 A# D, e& S; R+ ?" H
"std" => "",$ [0 }8 i0 r$ E7 {8 D' |
),
- z; H7 V4 z8 s* j. v4 Z( d& V8 P0 J; p s7 B
array( "name" => "</div></div>",
9 G4 W# ~, k/ M "type" => "close",
$ d. z, r8 D; W4 {, K; } ),5 i% }7 U+ z& n! p) s) }% g
7 T: R& ~- r) U Z 0 l- u# W6 L# b6 X1 N. a+ x
array( "name" => "AddThis Social Bookmarking Settings",
& ~6 }- D8 b) ^, ~ "type" => "heading",. D2 x6 G7 J; i* ~# j* f
),
; M) n+ u4 Q: s
0 b; r M4 M, x# t% g array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>2 l `4 x3 a& [8 {
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",4 Z" @+ p6 m# z0 s- L
"id" => $shortname."_addthis",
* X. [. N z& @- U: T "type" => "text",2 W& a% [! X4 M6 Q7 C( B0 n
"box" => "social",. Q. R/ v& ^. S
"std" => ""," K, n: v8 S- g6 ^8 i
),
, \$ S/ l, _: E: h, r# C J4 L# a# _- {% B
array( "name" => "</div></div>",
6 r& C$ q% f7 x" D `3 g "type" => "close",1 ~( U4 G0 `6 h0 _: m$ M
),
: x' z3 Q& z6 M9 |; |: u" w! H [- f# [% A' R' D
# D& u: W+ h- ~; L/ v
% {; X) T. k* ^1 r array( "name" => "YouTube Video Settings"," p4 Q% l6 j9 C/ ?, k6 T1 ~, C- k
"type" => "heading",9 {: H6 ?0 b% R `. F! V- i
),5 q8 c/ z; c$ c( o- O3 u
) V }7 J$ m( s; Z8 _8 w& j. W( z array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 W, L1 m9 N3 V
"id" => $shortname."_emvideo_activate",
6 ^7 i! j; ?7 s$ p "type" => "select",
8 |3 n6 y4 w0 R e3 g "std" => "No",
; }% @7 g; R/ n+ L5 M5 ] "options" => array("No", "Yes")),
3 r" K, c2 C" _$ l2 v& F- o6 z; }, u4 P v& Z' C
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",* l$ P+ P% t' U) \6 ^$ v1 V
"id" => $shortname."_emvideo",
& F5 u) k; u H" U$ t9 M "std" => "",
9 Y( a! h& V' C "type" => "text"),+ c2 a1 L" q9 F0 U+ T+ M/ Y9 H7 [
/ C% t. E5 @9 Z+ Q1 r& X, R
array( "name" => "</div></div>",
0 O, ^5 l& ~: S$ W8 [- A8 a+ ^ "type" => "close",: y% u; x1 |1 v
),
6 x9 V8 N) s4 ~/ W" X
) ?- Q* X! S0 o6 `, Z6 m array( "name" => "Twitter Settings",+ |7 l% X" @. e, V2 b2 V
"type" => "heading",
4 E4 ^" |+ Q1 A2 ]* G/ @ ),
9 M: T: N/ u/ G9 s3 D- A( o% {3 ]: W
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 \- l4 v# J/ O. l2 @, w$ A
"id" => $shortname."_twitter_activate",
% @3 ^! Q$ r2 I "type" => "select",
_) D$ p. m/ d5 f8 t "std" => "No",
) [/ g) U8 Q# u7 {; X: F "options" => array("No", "Yes")),4 g) F( o6 _3 t) n; T; n
9 R( A. \+ k6 Q+ C# o array( "name" => "Insert Your Twitter ID here/ d. p2 v0 C! u$ i
<br /><em>*leave blank if not necessary</em>
( H& s# ?6 A5 b, s$ q <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",+ M* b8 p$ r, e' N0 G" ~
"id" => $shortname."_twitter",
" \" b* P1 a4 }6 \$ t "type" => "text",8 q$ m& M6 m" V& s# A
"box" => "social",
6 i, ]/ k7 V2 [3 w1 ~ "std" => "",
: b+ S3 n( G$ D6 s, @! Q4 W ),
: [* C5 D. r! `; i7 i x" D1 S: i9 L2 D
array( "name" => "Enter Twitter Feed Count here. a2 m( j0 `( X# A8 T$ j9 x* o
<br /><em>*leave blank if not necessary</em>; l: W! _$ z" u m' t1 ^% ~3 m; [
<br /><em>*Enter How Many Twitter Feed To Display</em>",
* a* @8 n/ c1 F' n "id" => $shortname."_twitter_count",2 O/ P. S2 F& j: S2 C
"type" => "text",
) c) e6 `0 u; r9 u/ ? "box" => "social",
8 c. j! ]2 [: X" C& _ "std" => "",$ |* L* ]$ o& O) e0 L
),6 o3 P! }7 O7 t' G# T$ Y
0 g# {* Y0 v+ c$ J# l# E0 e" p array( "name" => "</div></div>"," W! G6 F9 q: G9 N+ H
"type" => "close",5 j0 L+ |. G4 V. y
),! \; G- B5 F3 [! ?. C! |2 [
# n7 `7 y7 E4 U* H- \
+ g4 b- k' |0 c- _4 @, p array( "name" => "125 x 125 Banners Advertisement Settings",
( C+ u! s9 F2 b2 S: f$ s: q "type" => "heading",! N; G7 j( V% @ x. s
),
' ^: R5 u# I+ H# u ' Z* q2 [1 z; j, |
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 c' u7 j# p4 ?7 Q/ t# Y4 |# [0 |
"id" => $shortname."_sponsor_activate",' q2 T2 {5 r2 U6 T
"type" => "select",
# i: D/ U' S; i6 s" | "std" => "No",( ^# s C Z0 H7 S) I! U5 E; k+ o
"options" => array("No", "Yes")),; p' a9 t6 f9 V" ]! S: R3 {
' M, f( a1 l+ E
; l) ~0 F: P. ? array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",7 i0 F- r' w2 T
"id" => $shortname."_sponsor_banner_one",# [3 h4 K( Y& x* T3 M
"type" => "textarea",
/ p6 N i, Q4 s' ]8 K x% g2 F: M "std" => "",8 S$ ~3 A7 ]$ ?3 n9 L% [
),
& ]: E, y% M7 W8 X' T8 f( X7 b4 m2 X: c$ r {6 s. f& ^
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
: J: X3 z! S% p9 K+ T2 U- D "id" => $shortname."_sponsor_banner_two",3 |2 l# v8 y6 \: A
"type" => "textarea",( d1 V G& u3 z; f' Q7 m5 L
"std" => "",* X* g N; X$ M
),
& \ i, J5 m4 T q# t6 n6 n/ }: p# `+ @/ Z
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
3 D- y5 s% d3 Z- @/ T6 [) ^ "id" => $shortname."_sponsor_banner_three",0 f# n( O) g+ E# d0 W
"type" => "textarea",
7 v+ P- Y0 N) v+ J8 J "std" => "",
: y& G9 a7 {7 `) Z8 ? ),8 T% c0 Q( i" E9 H* b1 a
: ^- `$ ]& U$ t4 I$ ]& [
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",; u8 ?2 N G, H$ W0 E
"id" => $shortname."_sponsor_banner_four",3 k. _5 I$ w. l! z' H
"type" => "textarea",) c5 V0 C; X+ j
"std" => "",
! z# z% y7 T; E6 c ),# o2 j9 X& b: f6 m
- ]' S3 G& d& t/ e- M array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
) H0 J0 _, k3 H "id" => $shortname."_sponsor_banner_five",' \" j" m9 X6 `* R" t( u
"type" => "textarea",) W' c. B2 |1 k' S3 A5 z. u
"std" => "",
+ j; D0 ]+ G* K! r4 W7 ]0 Y ), ?6 M7 o) i+ f- F: @9 t8 J! ^
0 p" q: \, L. K+ M' o array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
4 i- q8 P9 ?3 }3 a+ l "id" => $shortname."_sponsor_banner_six", _: z, l" M4 ^) Y# X) F
"type" => "textarea",3 r0 S" |9 |" ]: w4 |' I
"std" => "",
) F4 w0 I m/ z- J ),
7 c5 W, @( H) x
' a0 f& J2 F/ L% u9 ` array( "name" => "</div></div>",( n/ p. W |% R: B- n
"type" => "close",
1 u' Z& {6 Y: w) b7 t; U ),
- |8 e, z! v% J( O# |- s- H% O; b& O& U2 X
1 l& P: h0 C; a6 e) d
# v1 S" X+ G- j. y! `8 w: v2 | C);
2 S2 B$ M+ p, p; r
! L+ ~% N/ N; [1 C: H, y9 I2 x1 lfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
8 ~ A& `9 x0 M. E4 r0 k+ e+ ?. L
" f2 h( p; ~3 }echo "<div id=\"admin-options\"> ";
9 S& F: n% f; B5 c1 K/ M* y
b7 o4 B" V2 A. p6 q5 {global $themename, $shortname, $options;
7 S$ F4 d( |2 m# [0 a2 m( z( E( jif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';* \% {' G* h6 `& M+ c
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';: C5 S4 f0 ]$ g0 y
?>
2 H! e5 }- J% z$ x, Z
. T5 X7 w2 [" v<h4><?php echo "$themename"; ?> Theme Options</h4>
4 l, x% Y' Z/ o/ ]% I! k
/ e! f3 O2 e5 e8 q<div class="annouce">
7 G9 d) D4 M9 i& N- `<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>, b+ S$ t. a( ^! H8 I! s5 ^
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>( g9 _& Y7 V! |
</div>8 ^. L$ `) Q1 S. A4 |+ h
, c+ i$ I2 w8 F* Y<form action="" method="post">
0 S& [. S; l8 ^' _. X5 P$ V( }6 U! C+ G
<?php foreach ($options as $value) { ?>& z" R3 O2 L/ C L% j4 v
5 G4 k, s+ E( |+ m, F
<?php switch ( $value['type'] ) { case 'heading': ?>* T" `3 t0 [5 J$ p: a5 K
0 X3 [) Q E) y8 G2 ]1 e* Z0 |
<div class="get-option">
/ F6 g8 |# B, f( |' y# ~4 j. ^% @3 J4 k, e% P0 D8 g8 G' O8 w! T
<h2><?php echo $value['name']; ?></h2>* I" B/ \2 L% [1 y* G
% n7 i$ V7 }2 Z# x
<div class="option-save"># T+ X* v1 O4 k5 e. H
( K4 f1 h* k* V* }/ i8 J
<?php
6 R2 b/ s1 |- b, k7 U- D5 Ubreak;
) o4 b2 c% K+ Z1 H" Dcase 'text':6 U6 Z# b" e9 H
?>
8 s2 F: N% a, D& }. ^- w2 j2 D& C# }; V2 I5 P* t
<div class="description"><?php echo $value['name']; ?></div>
5 c5 }; E8 L% z' u* h<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
+ t5 i( V! j j/ g1 Q7 h/ f7 [1 Y& ]/ w r7 q3 D: h$ r' M' a. l
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
# c+ z9 |2 M3 Q+ J+ j; B1 j5 b$ ]/ [3 h! z- k- z5 i) U+ z
<?php
6 x, ? B' z$ U. I" Ibreak;
# J! Y3 o) i/ {case 'select':) V/ D1 v, t3 V% \" q* p" q
?>
5 ^7 m6 L: P3 B, K5 ]5 @5 v F) @& U) r" f b2 I7 o& j
<div class="description"><?php echo $value['name']; ?></div>
( ?4 B, q% Z. u4 r# Y' ^<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">6 K! k: d- T! Z+ S/ [) L M
<?php foreach ($value['options'] as $option) { ?>6 }! i1 U$ `2 B# Q: M8 U
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option> R9 m; c7 P+ u, t/ z) l. `! \3 z
<?php } ?> C1 m7 Z9 I2 e& h( m
</select>: E( U- \4 [* F2 X! }
</p>8 b' L( \ i q3 [" t
& Y4 H0 |! g9 ?, q
<?php7 {# V0 ]$ ], t
break;
2 {! h% z+ u$ lcase 'textarea':& g7 ?9 A% i) @% J
$valuex = $value['id'];
) }* f% w( S/ O7 ~* h& I, H$valuey = stripslashes($valuex);
3 x! X0 k. x! [* ?# ~$video_code = get_settings($valuey);: G3 {8 n5 T1 R3 _/ _
?>+ W& H8 I$ r5 D+ W9 g$ D/ W
8 u1 v0 S* M: Y, I& E% D( _
<div class="description"><?php echo $value['name']; ?></div>& x) \' Z% `! U5 f8 @+ p2 S# ^
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); } w" q% R X1 B1 _, R
/ ~3 Q7 c( n3 K, g. Zelse { echo $value['std']; } ?></textarea></p>( i# u) |) t# A
' u0 S7 s& \: {/ d
<?php
6 ^1 {3 K' O7 Jbreak;0 v. ^/ v6 S9 F: t9 e5 m3 ~% M
case 'close':+ [/ Q; M6 Q( y( m" c# k3 e% Q
?>
7 E% s1 U4 _9 k/ x
+ f" r8 ` i" N5 o4 I. j% ]<div class="clearfix"></div>, [% A1 `, W% G% k. E
</div><!-- OPTION SAVE END -->
% s: F( v; W( a0 p9 v/ I; z% n5 i8 C) J, j* D, _
<div class="clearfix"></div>
' A9 b( R K+ |& Y</div><!-- GET OPTION END -->
/ G5 k" U c; A+ [; E2 q% E' K$ r2 J* H
<?php
4 m/ x: _4 O Bbreak;6 r" [* Z, C: u# J, N8 E
default;
( V' g! F2 ]* P?>2 K1 Q- p' P7 S% _3 ]
. q J+ m; \; F1 w9 w! v0 G) a
* r0 E2 a J2 `, x<?php* J+ C5 q* O, |+ m! ?$ N
break; } ?>
6 ?7 a* s; Z2 l* T6 N: o/ x* f7 A6 X
<?php } ?>
& }" R1 N& q; m5 n: E* y, M) e+ ?5 n! O1 c( g/ H4 ?
<p class="save-p">
: ?% z. R0 q- |8 S; ~: q& v<input name="save" type="submit" class="sbutton" value="Save Options" />/ p! ]2 ^" D9 o O6 Y* E" X$ n8 w
<input type="hidden" name="action" value="save" />; L* C3 P+ h% Z i7 U; i7 v F7 ^9 _
</p>" x+ j* N4 n" |* v
</form>8 b1 f/ x4 v, b" q9 N' s5 G
2 |4 y2 ]' C1 S7 x8 h$ O: U* m
<form method="post">4 f& j5 j# i$ ^4 O8 d, a
<p class="save-p">
+ z, n- c S# O. n<input name="reset" type="submit" class="sbutton" value="Reset Options" />
2 l6 x0 W* X3 Y( F: _<input type="hidden" name="action" value="reset" />0 e' E9 M, Y4 g1 k: }9 p' Z
</p>8 L: g1 y& s6 P6 w% G
</form>/ b1 S) @. a* J+ |- A% l, p
9 Z$ a* M) @, K) m( x+ y+ ?</div><!-- ADMIN OPTIONS END -->
2 J7 N$ J0 G. d/ r5 B8 q5 X! f" j# Z- v9 V! @# D+ R1 i
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
0 R1 B2 }- P# d1 l6 p8 ?/ V- _ Y, a% u
function mytheme_admin_register() {" m n, n2 o% l' D) ?- i, I' r# ~
global $themename, $shortname, $options;8 h, z8 s3 C3 @% U, ?6 i" u
if ( $_GET['page'] == basename(__FILE__) ) {
+ M) k$ c/ ?% W( eif ( 'save' == $_REQUEST['action'] ) {! P8 m7 R4 |6 Y3 ^1 y
foreach ($options as $value) {
. u% @# `/ T1 u* X4 Aupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }6 J0 H+ N$ N6 Q' x% A6 x2 Q! W
foreach ($options as $value) {, @( E1 l& j. T/ K: \% a/ ~
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
9 W/ R( z! B4 J2 j, Yheader("Location: themes.php?page=functions.php&saved=true");- ~$ Y5 m# Q6 Q$ s
die;
! @/ [5 ]- T1 \ A) q} else if( 'reset' == $_REQUEST['action'] ) {( q! \: Y) w) r$ c. u# F( `
foreach ($options as $value) {
6 o/ C7 a# D, K* l/ Odelete_option( $value['id'] ); }7 S) O- R8 U1 c! Z) X2 y2 C( D# G
header("Location: themes.php?page=functions.php&reset=true");7 F+ d5 T5 b* o" |- j6 F
die;* n0 r' @! g7 b9 W5 f
}
4 F" X4 p7 f2 X R( C/ Z2 `/ q}
% E3 M: O4 c- @- Z) w2 @. xadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
$ Y5 r* m, N$ {1 H, S4 @6 c}
7 s, O$ A q o* F
) t' e k; g. E+ V. E A5 zfunction mytheme_admin_head() { ?>
3 x6 @) r6 H% @, I [( ]6 [<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
9 d2 L9 ^; p# w<?php }
}3 a9 a2 q( L: r5 L5 C6 F4 s |
|