|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
9 q+ _" V# P9 h3 q4 k1 e# M// Theme Option' w% F K$ r/ Y& C, O4 f0 }+ a
////////////////////////////////////////////////////////////////////////////////
+ q' U7 |- b1 Q' m8 p8 f2 ]
5 I" k# ?6 T9 b6 l$themename = "Zenx";
1 i, F* d4 l. r7 y, P$shortname = str_replace(' ', '_', strtolower($themename));0 _: _, V$ F3 y$ I p/ `, s& K( w. O
- }* `3 T7 B. _3 a" M# gfunction get_theme_option($option)
. Z) h) }, _: F7 S. p{
* T1 f4 { U" p/ d( n2 d global $shortname;, `9 D! _) ^0 ^6 d2 P% Z
return stripslashes(get_option($shortname . '_' . $option));
6 c5 I) i' X" l8 _( Q8 }. E}
8 j* `, _9 ^% g9 `( F$ L
1 |/ y! }+ b4 F9 S( afunction get_theme_settings($option)
4 m6 r, A9 w4 M; y$ I5 W{
& I+ Y+ V, H# ]- J# { return stripslashes(get_option($option));0 x2 ^% |) ?7 g$ O. T. d9 m# k
}5 Q( I7 V; @( S* r- ^4 Y* e; s
$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");9 r' K0 f7 g! J
$wp_getcat = array();& k a4 \2 F" h
foreach ($wp_dropdown_rd_admin as $category_list) {
- ?: g! n% `$ B+ p$wp_getcat[$category_list->term_id] = $category_list->name;
8 }1 u5 ?+ r7 E7 J+ F& X. A" I}4 x2 W. D& e& ]. y9 z- p, R
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
' [+ O: C' y" f4 t5 h, J$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
) A/ n- h6 _, y# ^3 `/ I$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");7 t$ m8 U* B, K4 [/ T" ?- u' b
, }6 _* g$ Q7 ]6 C1 `; Q6 L$options = array (; ^2 b3 O) B0 |1 t1 Q
$ T6 D: r3 C( i; i* p7 }
9 G# d* P3 l( O. _ array( "name" => "Blog Header Settings", M! m. i9 n- E: q2 j) K7 M
"type" => "heading",
$ A2 `' E7 `# B0 P. {" @ ),# l; H+ F7 c- y6 G$ o
& t8 ~4 \+ {3 z$ {) m7 { array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 m9 i$ E% A8 G, M3 X, X, ~
"id" => $shortname."_header_logo_activate",
4 `' y3 g1 b; F6 v* u' x "type" => "select",
4 Y4 \3 }* }# K/ c3 k- B) ? "std" => "No",
8 J D, h- y5 g. H7 z( U "options" => array("No", "Yes")),
& N; D9 J' P) a: n* M! V; d( U. Z4 H" F3 C7 T, Z
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",# V6 E- q" F. T$ V- e) j( I
"id" => $shortname."_logo_url",
0 S7 k3 [4 i* q' J, t, }1 Z "type" => "text",
" F! B' X& O( u" X; _! S. y2 P+ Q "box" => "social",) f3 ^ D. e9 j! r8 ?
"std" => "",
4 e: m8 N' A7 f& N/ b+ B( @. e ),
* s6 q/ R! z/ ` ! Y5 W0 h, ]% }. z2 O
array( "name" => "Insert Header Banner HTML Code (Header)
1 f( c+ B9 b8 t) b+ f6 o <br /><em>*Recommended Size 468 x 60</em>$ `5 [9 {6 N3 |7 k0 A
<br /><em>*leave blank if not use</em>",
/ w/ b( R. ]" d# {; E2 ^ "id" => $shortname."_header_banner",6 \/ q2 B0 D8 [4 ] E ^
"type" => "textarea",2 ~5 A7 }$ J) c; j6 ~. [
"std" => "",
- P" m+ ~) ~, ]: E* ^) e ),9 W! Z. [2 M# C) o' u
/ E9 [1 i, D5 V! q& [
array( "name" => "</div></div>",
; B6 {3 q: O" C( \7 S8 z "type" => "close",
E' {3 x \% u! T- W7 r ),2 V$ J) j) G7 a5 V9 x1 F; o7 E
$ _& K+ U2 @3 r) c( t- x3 n1 ~8 D7 n0 u5 ^- U$ n' f
array( "name" => "Header Navigation Settings",
# R% H2 [! a% _7 M3 P$ A, L! F "type" => "heading",2 d8 W/ I# @; K+ f' z
),
5 s& {# }# ~" x5 X5 v; ` j1 ~' D' Z1 p& F. p9 h; o; Z
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />* h* ? _3 R# g2 c1 q- ]
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
' C" _' {0 I6 H6 M/ t8 w <em>*Enter the page post ID number only</em><br />0 M3 h7 [! _: S; @& x; `
<em>*separate by comma</em><br />4 I5 h8 W& U f, U. Z3 {: p5 D; I
<em>*Exclude pages which you don't want to show on the header navigation</em>",
# @+ x; G' }# u& k x* E "id" => $shortname."_header_page_navigation",
" c4 R, r& S. m2 [& Z3 Y/ O6 x "type" => "text",
3 T/ N; g* ]- X0 q! t2 {, J& x "std" => "",
* n& _' l5 c* i. P4 l: @ ),
9 @) K1 n- K& T6 D4 a
. h% U& m) m; a. _- @9 m array( "name" => "</div></div>",
: z* N. y8 |- ^+ {8 r2 D. H "type" => "close",
, w: F9 S3 y4 ?1 C ),
5 ^/ _* E& t/ {/ S" I 3 ]6 a" M6 w7 N5 F
! L+ D, ?( L1 [# Y% }; d5 o
array( "name" => "Post Auto Thumbnails Settings",. l% J' k3 x+ ?
"type" => "heading",
* r; g; [1 Q/ b8 y. ~ ),
3 ~( J$ ]" o& u6 b. W1 d" N $ u5 D0 N! ?; @! S. `- X* {
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
e& I# Z G0 L) e "id" => $shortname."_timthumb_activate",
# d" y' s6 ^+ S% `% B "type" => "select",
1 z+ b% s; U0 I1 e0 E. b& F5 \; U "std" => "No",
4 Y; O# r+ J3 \1 g, w# _ "options" => array("No", "Yes")),( {5 s8 M( \) B
1 m8 g+ R) k% o; f/ P array( "name" => "If Timthumb is enabled, Please choose its cropping method",6 B/ ^1 l; [ N" ?5 P
"id" => $shortname."_timthumb_cropping",
9 K& i0 T2 R' u; Y7 m, D "type" => "select",) X8 j0 j* i% ^& |/ M8 w
"std" => "",
! d2 \7 F- ]. V! C2 a/ P( B% q "options" => $crop_position),
% F5 h7 M9 q& @ T% L0 t7 }, Q& a- C" U6 f# o ~- T) N( _
array( "name" => "Insert Width Of Thumbnail Image<br />3 S8 y J# u8 ~* i; Q' T
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
6 l: f% Y$ X( v! j% x- w <em>*Leave Blank To Use Default: 250</em><br />",( S; a7 k7 ]4 F1 d0 g
"id" => $shortname."_thumb_width",
9 ?9 N ]" d! n) u: `# T1 m' V/ d "type" => "text",2 V1 q2 B; u! l5 R9 P, m# E
"std" => "",
: C) J4 o) D* C4 _/ q9 l ),
$ g9 R ^3 k9 Z/ f. f8 N' Y. T7 d2 o( J S2 A
array( "name" => "Insert Height Of Thumbnail Image<br />- N3 E o' z/ p' l
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
. d ?/ ~/ w5 I) l7 C1 V3 Z7 o <em>*Leave Blank To Use Default: 200</em><br />",
, G/ Q, E& B1 B) }# l "id" => $shortname."_thumb_height",
1 k. O. F: y2 A+ Y# m "type" => "text",# X8 u: I! B9 ?* [- s
"std" => "",
; }2 L* l, _- d+ k ),/ X) Y% x7 a' G1 _
s9 D8 j4 P+ ?4 d
array( "name" => "</div></div>",; g2 `* q$ z$ x
"type" => "close",
5 M: {0 y! Y6 ]9 N/ c; S: b/ Y ),
4 X( ~& a, ?7 {7 p7 h0 y0 t3 K9 H& Q" X$ P3 o& X0 B
array( "name" => "Featured Content Slider Settings",
. _/ z# s1 _5 S) g( `. l "type" => "heading"," m' j* S3 p k) W, x0 m9 @ Q
),, M3 j6 {5 Y/ c; W l' ]: E' e9 b
7 W7 }# I, ?# m! f, ^# A- ?( a
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% i: K0 [: T g6 y
"id" => $shortname."_featured_activate",* N, I. O; Z% v( ^6 M) O
"type" => "select",
5 e. w$ i. V: r H8 V "std" => "No",: n5 I! C- n6 f5 q1 D
"options" => array("No", "Yes")),
s, p) ^0 {) {0 Q7 y( F9 u+ O) ~3 @
A' U' @" s3 K4 r array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
: ]+ e u3 M% l! g% d "id" => $shortname."_featured_category",
7 ~, x2 h" `: c1 i) n "type" => "select",
* e6 a3 i# i( L4 M) c "std" => "Choose a category:",. J2 N' [6 g+ E* Z: ^# P* l
"options" => $wp_getcat),
& e6 N, B* P+ r2 m( Z4 h; }) y4 _. k5 k5 f# k- N
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
+ o0 C7 x! @; o1 n "id" => $shortname."_featured_number",
( f3 w& X/ R; m3 x. v "type" => "select",. u4 n. Y5 |7 |: }; L8 _( K+ T5 B
"std" => "Number of post:",. G! g0 w4 m% f. f
"options" => $number_entries),
" u8 f% Z$ E' {3 I: E! F0 a5 c y1 N) V6 c* D- V
array( "name" => "</div></div>",+ C/ R9 C' l. Q2 J2 G; @- H7 S
"type" => "close",' D- N3 @0 w! B- c
),* i& R, n) ^& {& Y K+ O: C
/ b* y& j% _; n: e% V array( "name" => "Featured Category Settings",
. ~% ]' l4 y. _" {5 {: `+ T9 l/ b "type" => "heading",
2 i" J0 }2 d3 {" `& V ),
% ?( P% I; E2 s4 M2 b
1 a6 ^0 ~3 d3 n array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% ?. f3 A, D0 w6 n
"id" => $shortname."_featured_category_activate",
+ p+ D0 q3 }$ f8 e "type" => "select",9 i$ F) N, P/ i* `+ \
"std" => "No",
$ Z: s4 u2 {/ a; y9 Y/ e "options" => array("No", "Yes")),1 G2 \9 p9 v, K3 b) O; H
" q. U' Y* x1 x+ J, V
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
1 h1 ^, I. f( b' T3 F. @+ O: q "id" => $shortname."_featured_category_id1",
( k; |: s2 m- ~5 j( u1 A "type" => "select",
( t, Z+ R u% D! E8 b" a "std" => "Choose a category:",+ s$ r5 J2 {3 N' ?8 V. _' D- ]
"options" => $wp_getcat),
# v. K, e& u5 \" Z : [0 d* m" U7 U" }- d3 H
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
' N" E% q( G8 _' t# J+ d5 O* n "id" => $shortname."_featured_number1",
+ s0 I" J7 X9 `4 Y8 _ "type" => "select",% T. a; h. L+ q! q [" y, N
"std" => "Number of post:",
9 K2 S# y7 G% Z6 `: F7 ` "options" => $number_entries),4 x7 K+ `/ @# c1 ?
" z X& S8 y/ k# } array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
7 q3 s) g q$ M% N0 b& n2 Y "id" => $shortname."_featured_category_id2",% v/ M1 D- Y- V. c8 j% b$ }2 }
"type" => "select",2 B5 M3 v' F2 p* k
"std" => "Choose a category:",( @- R7 j; [4 `6 `' H
"options" => $wp_getcat),; ]4 s& Z9 W( c: e
. C& g* ~! t! H
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",; ^8 d& G1 R+ q3 c( N
"id" => $shortname."_featured_number2",
& ~ v4 ~# h& ]- a) N) f& s* v "type" => "select",, F9 Z$ [% b4 B7 ?* A3 ? x* [% C
"std" => "Number of post:",
9 _; R" j: ^, a8 P1 f- m "options" => $number_entries),! U! v- W' g) |" W! D6 H5 D& K
* G( l# s( a1 W! g* z9 k , k7 z6 N" ?) @0 A7 g6 N7 |
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
& i# u4 u! m, I "id" => $shortname."_featured_category_id3",
' w* n/ O$ g+ ]+ X2 }8 `% d "type" => "select",
+ c3 l, g: \& b5 E "std" => "Choose a category:",* ~6 ]# v$ F( Z3 b- T
"options" => $wp_getcat),+ ^9 E! q6 L0 y. h: r. L* {
7 a5 U+ c( M8 p" F7 q
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
; B+ c2 q- _1 K "id" => $shortname."_featured_number3",( \/ a# D4 O- q, F# @ n! F% R
"type" => "select",
6 U/ i9 d5 a3 Y' m& g0 b! A* |0 j1 |7 A "std" => "Number of post:",5 v( i+ `0 p& j+ |
"options" => $number_entries),
* u6 U. v* }; C$ l( c- U- B
0 j5 _; b- x( Z0 ^/ Y8 k$ O& O" v7 S! a9 W
array( "name" => "</div></div>",2 j8 h- W0 X0 S6 n0 p
"type" => "close",
' e, u% W- p' C* w) h ),8 W! d5 D" e% T7 r. a0 g
A+ j1 a5 ^( H* K \& V
% Q6 W% y0 L. _3 K( U array( "name" => "Google Adsense & Analytics Settings",% K; y, X; {8 c- U% d& ]( U! w$ \
"type" => "heading",
2 r+ G6 Y( r! f! u8 m+ F ),
4 ^1 I. S: Z7 D1 `
2 J1 `6 I; y' [+ D array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
" `. f4 x" E# ? "id" => $shortname."_adsense_loop_activate",
/ }# L3 n+ L3 N1 L "type" => "select",
]. M# w: p1 y1 W; C "std" => "Disable",
/ ?, I- A/ ^! _) ?) _; W "options" => array("Disable", "Enable")),% X4 G5 y$ j. l) X. E3 j6 [
7 G1 A% F& P5 f' k6 @
array( "name" => "Insert Google Adsense Code For Loops Here<br />7 [5 f1 O j! n! M
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>"," l2 K9 W7 E) }* _& y5 C
"id" => $shortname."_adsense_loop",2 h/ x6 c% D) P0 T+ q; O. F5 n
"type" => "textarea",
. q2 p+ Z( W8 D5 Q "std" => "",; N+ ]6 N6 }3 x" @" u5 c$ A
),
) `7 [% o1 ~4 R' d3 ~" G& Y9 c0 f+ G+ f8 p5 O8 A" c
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",. P' |2 D8 ~9 Q' k* P) A2 s
"id" => $shortname."_adsense_single_activate",
7 e- \! ^, R( T6 K% W "type" => "select",) D: j/ J3 H8 J4 T1 W7 r
"std" => "Disable",
. s0 @$ S- ?! D, v z, y- g "options" => array("Disable", "Enable")),
: v# U: Y, ?$ V# ~* |; ^9 _
- l3 c5 G8 U( I, a array( "name" => "Insert Google Adsense Code For Single Page Here<br />
$ Y1 v: P; V& u7 [ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, H+ g1 m3 e1 N$ k5 T8 I3 X- G
"id" => $shortname."_adsense_single",
7 N" d5 ^1 l: ^# _, ~- }6 p "type" => "textarea",3 z- @, l' s. M" l. p
"std" => "",
: G& k; T; F' |; t5 t2 }+ S# H ),7 y- b! p) k8 G- n9 M
+ v$ l: _4 {# v5 F$ l: e7 {
7 s( O: I. g _ array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
$ _ l% j g+ l "id" => $shortname."_google_analytics",3 _5 f. H0 j% X7 p% G
"type" => "textarea",! _& ?$ j0 m0 H, o5 f
"std" => "",
! I) @2 L1 ~* b6 \1 ^& \* A ), K) R& {$ |6 {* O/ t
0 i4 x- e( G) k$ v, ?, V array( "name" => "</div></div>",( C, K& R+ W9 a
"type" => "close",% c( a+ b1 c1 @ [8 `4 A9 e) b
),
( H1 ~3 t( [ l' s
, d- u9 E% _; W( p8 p9 C0 R5 v5 a3 {3 C 8 d2 r& v3 h0 p7 B3 j* F, }3 n" P: b
array( "name" => "AddThis Social Bookmarking Settings",, Q7 o; t: ~$ a# m1 x
"type" => "heading",7 ]6 N5 n1 [/ V$ Z# b. {4 _3 f M
),% h' a7 A; k6 D: V' y3 a ]
/ \" S' ?* u7 K* _% O/ S
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>7 B# V) h) W$ }$ r9 }
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",! P) o- y8 _- ]: j: t
"id" => $shortname."_addthis",
& E/ B5 S2 M: } "type" => "text",, m: N R5 ?8 ^! j# d
"box" => "social",
1 Q1 _1 ^! t4 r "std" => "",
, }: @2 G# Z: _7 |( t ),3 d g: r' U/ F& ?0 G
" K& W) V8 \1 B% p array( "name" => "</div></div>",
( k; d- W8 ~& Y6 @4 r "type" => "close",5 ^/ K4 y6 g) q9 T! T) g( u
)," u5 w2 _8 X. H R: L
4 X2 E' j' M p, R, M- Z7 @
q4 d; v6 u/ B4 [ % g; m: p$ ^" Y' |$ j& p
array( "name" => "YouTube Video Settings",2 i3 A; n) A1 q
"type" => "heading",& {' Q0 C! S0 \) W% {& T* @% ~. b
),
$ l* V1 P6 a$ Y7 w ]$ c) z
* t* Q( G$ A; ^ array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ ^6 s# X% _9 O "id" => $shortname."_emvideo_activate",- o" M# a9 |4 {! I8 x! T# q* z
"type" => "select",- a) k. Z: P, V1 ~) @% l2 j
"std" => "No",; N& U, k" N, r& F
"options" => array("No", "Yes")),# [- i8 Z2 P* {( ]6 X, ?- h' V
) R3 u E U* u3 _% ~* I0 v 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>",' n) ~. i* G& i' F1 x# _( [/ s2 r
"id" => $shortname."_emvideo",
2 V: J7 y8 R2 j% d' y& B "std" => "",/ c& }. b- d2 }% p
"type" => "text"),- N3 [, s% J0 }! I
' b" S0 Y) O$ B9 a( P array( "name" => "</div></div>",
9 ?" L( j }- \ T" C a "type" => "close",
' w- O% o, n& x ` ),! c; H3 A2 M. H7 Q; E, j3 B
; ?3 I. [( k3 Z, e/ W; ^
array( "name" => "Twitter Settings",
) x% y0 j! m7 D3 ]0 ~. g# F' L3 R Q "type" => "heading",
. D; U j9 X9 K/ G ),6 A( |8 N% C' r% a u; z/ y" e
5 K1 F. @/ S. _# \& S [3 y- c% T
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
# J% n9 {( Z @' U "id" => $shortname."_twitter_activate",
) Q- b# m( Z$ q8 t! }: g' R "type" => "select",4 @2 Y8 d$ R: c* }+ c& l$ x# Q8 U
"std" => "No",
( `+ Z; d1 z. G% M1 H "options" => array("No", "Yes")),
) ` N) [, W$ U) u! F2 N3 t( N) @
array( "name" => "Insert Your Twitter ID here/ G& e+ C& C: R
<br /><em>*leave blank if not necessary</em>
) e2 ^; N4 o( F5 u) m0 w' E' E- ^ <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
! Z! A& l, Z: Y: g& U# c. B& ] "id" => $shortname."_twitter",
2 h/ O+ Y1 ]4 ~, \+ q; G1 K2 \ "type" => "text",4 Z! f6 `. V5 j/ V$ F2 m! w8 C8 r
"box" => "social",4 g# Z: y9 E7 s0 B* p
"std" => "",
! J% g7 C+ \* P/ B* l, ^# P ),
! M' A X6 O5 b! F. S( G
; E' v, J2 D9 }; ?: w+ |) T array( "name" => "Enter Twitter Feed Count here
0 Z* K" \; w/ J, l <br /><em>*leave blank if not necessary</em>, S8 Z9 H2 r5 P
<br /><em>*Enter How Many Twitter Feed To Display</em>",: {: v& u$ {' ?; E
"id" => $shortname."_twitter_count",
( j7 i( i7 ^8 Y Q, T4 A$ Y/ y "type" => "text",$ Y% G, q. Q! K+ }! y
"box" => "social",2 O* A8 }; c, Z& a- W
"std" => "",
N/ A% |; C# G" Q ),* F- Y& D4 ^3 B2 N2 ~
2 d+ E/ I# b* t. D6 K3 y
array( "name" => "</div></div>",' d* L0 ~6 B6 [6 r0 Z! T2 y
"type" => "close",/ ~3 E% `2 Q/ o& X) F
),
$ ]! J$ U9 T& v P" m) M 7 c) c3 L' ]( |7 Y B+ m* P
1 ?' W$ T+ |- }' ` array( "name" => "125 x 125 Banners Advertisement Settings",
_) C5 {) l( [* P6 Q: Y( m "type" => "heading",
; {, Y* g/ V9 _& K ),3 p- L. J% `, s K3 E+ Y
! H% G; Y0 X9 f. B9 P8 v& E
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& p0 ~6 p: x! R$ D "id" => $shortname."_sponsor_activate"," l- ^3 z6 `; g0 o' R: q. Z
"type" => "select", ]- K" H! \1 Q6 ~3 z r, a6 |
"std" => "No",
# B' j3 r; n, e: }% s- Y6 | "options" => array("No", "Yes")),+ `' x* K/ {: s. l! G; o/ ~
9 C8 d: M: u/ G
' d% k* B x8 ?: I1 S
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",! i& N* n) }% g) N, V
"id" => $shortname."_sponsor_banner_one", p) W! e7 [1 P
"type" => "textarea",# B+ T9 y6 S; _; x$ J! T# P
"std" => "",
6 l! |+ c5 C' Z+ `1 j$ B ),
# L6 I) F) ^, m' T) L! [- v: W
0 ^9 l. o o1 J6 a: w+ d; [ array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
+ H1 C }+ b% m( u4 } "id" => $shortname."_sponsor_banner_two",
& L' B$ h, |+ [; M, B% I "type" => "textarea",( i" A3 H- E5 h2 r
"std" => "",( A5 f _1 k3 O% S7 H# |
),& T( i$ R+ \ K, D
& k f G5 m8 ~& f! R array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
0 |+ m/ _8 Z0 A "id" => $shortname."_sponsor_banner_three", Y$ b7 f: |4 l( h U# i
"type" => "textarea",6 |0 a+ L9 }) n1 A9 j% k
"std" => "",' e& n% k/ g! \, z x& S
),
8 N* \. o* y V6 S& H2 a! \, e4 J& `7 J/ k }
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>"," V1 H9 Q( _& n, i, t
"id" => $shortname."_sponsor_banner_four",0 D% c0 x2 N/ D) m" ~4 ^
"type" => "textarea",
2 K, d# k" b$ w "std" => "",
; ~! v/ D# L* I3 C# V8 ?* U ),
2 ~8 {% R) J1 o8 B6 [/ Z% Q" a( r; A3 l! [, b
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
% a4 f, G3 @* F, d "id" => $shortname."_sponsor_banner_five",2 S! a5 S( d0 E) m0 o% [4 Q i
"type" => "textarea",/ V j( h" _/ A
"std" => "",
% O* j6 e& f3 n# N% Q3 o ),% C/ o; t) M A8 m* Q u
' w% A% T6 w, Z' Q! o. H0 K4 ?
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
: O$ T% M5 @+ {: } "id" => $shortname."_sponsor_banner_six",9 u7 n! `0 v8 l! S% Z( @
"type" => "textarea",
; U' |. q9 t/ ~$ K1 _ { "std" => "",
: s9 N( v) F8 G5 z ),
0 S' ~) b& d: q! g( A3 A2 a( w1 X/ V4 |; F4 ~
array( "name" => "</div></div>",$ z( r7 `: m3 M
"type" => "close",
* d$ H- L J& P9 n D" `: p9 ~ ),
7 f" [$ n, P! P7 l$ k% a& L4 Y' {: X4 i2 V O
# o+ x; I. N$ p' _
t3 e" Q" O# z% Y0 J$ v9 O);; \4 i2 s4 ~0 P
3 \9 |3 O+ o w, ?! s* q8 a3 j8 T
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {9 `0 O4 Q! U5 g8 h) E) K+ R, L( q2 S; Y
. R, | A% b' k" ?
echo "<div id=\"admin-options\"> ";
! G: K. \& z; J1 w% H) g( o" S% D2 {% }% e* K+ w4 q, `
global $themename, $shortname, $options;: M( l* q' M; t; z1 n# C" C+ `! s
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';8 O: G6 T0 x2 H! u2 o6 V; L
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';* ~! _: T% _& V8 W3 T8 k. _, d* Z; u
?>; A& o# _: o* @- P
# w3 f4 E7 v! t) L. l1 `
<h4><?php echo "$themename"; ?> Theme Options</h4>* t$ c1 ]- A( [# k2 O- s( u
4 C; K; Z0 i4 x3 o+ F0 x ]# @& Z
<div class="annouce">
2 W2 l4 O8 Y0 X( E8 d1 z! z( a<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
% u1 O& e" T/ ?- }% p<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>( I+ j( g* i2 u7 l- {" K/ Y
</div>2 o6 x) n9 p3 Y! {8 M" n& E+ P
3 a: J! G* L8 q2 ~) f; w1 ~' Q5 P1 w
<form action="" method="post">' ^; b% B6 A N5 r* \1 }; z
9 K/ F6 n) d" S8 c" y& J4 D: o3 X2 q
<?php foreach ($options as $value) { ?>) y2 J5 ]$ b$ |* Z% Q2 M
* H* @8 ?3 V9 v% A/ `9 y<?php switch ( $value['type'] ) { case 'heading': ?> k- P+ M) N! q% x- G
, j. u$ k* f4 D
<div class="get-option">6 d8 V' q/ {' ?, R8 B
3 ~- v7 Z" [ ]: S0 @3 I% y<h2><?php echo $value['name']; ?></h2>) Y2 U* K; \7 f6 [) m3 C8 X
) m9 U& u' V" @( j5 |
<div class="option-save">' e7 _, E I: @7 ^
3 r; o1 M% X0 w+ I<?php
7 ~4 C- x& k/ Z8 xbreak;
' Q/ h5 @ `! k2 b& w, Kcase 'text':
& H- g" B4 [- }' N4 _, ]( d?>, L# V& r3 r7 O5 w3 Y
& Q* u# `+ i7 y6 N# ^<div class="description"><?php echo $value['name']; ?></div>
4 I- i; Q+ Y) V1 W! D<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
" h s* w5 Q* ]1 r: j) e/ l) q& _& x+ X$ U0 J* h
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
$ `9 [3 P& [1 H4 x! c/ v
, r4 k' K! q! m6 o7 h4 p( |<?php
V" I; G6 f6 Z2 u+ u# K/ @" Obreak;
* a& z5 o! L2 L7 ?) zcase 'select':
2 }; g& K1 o: F0 o8 Y?>
! P' U- I& ]( H7 j. ?( E( {5 f. S; K3 y g! a
<div class="description"><?php echo $value['name']; ?></div>, {: C8 G3 f- _5 B ?& G
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">) L8 j6 Y* V5 g7 {
<?php foreach ($value['options'] as $option) { ?>5 X6 u$ T7 `: ?: x8 }5 l; C, x; J
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
' L" a/ i& f' P; F$ s<?php } ?>
1 R0 E1 _* o, t: F% O; r t* F* Y</select>2 G/ D/ Z/ P* u0 b" X! i
</p>, O) |6 O0 S$ i
9 K3 u- G4 K7 F: h<?php4 ^* Z% J% Q- U* ?
break;
6 e2 r+ m- z7 q g' v/ Xcase 'textarea':0 o7 Y' e1 E4 D" l. l, D7 O$ r9 s
$valuex = $value['id'];) O' r6 O c. I' F# f- B7 ]
$valuey = stripslashes($valuex);
% W! C! r9 z z$video_code = get_settings($valuey);1 V+ ~$ G4 x! z2 z! ~: d- O
?>
( u. s: d: `: t9 q7 Y% j& i1 `$ g5 ^4 @6 f$ e
<div class="description"><?php echo $value['name']; ?></div>
5 d- q; J+ M0 M% s7 @4 f6 W" H<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }$ A* k: F# z: T- X0 K
/ L) E% e' n% u7 g' N
else { echo $value['std']; } ?></textarea></p>2 G1 `; `# Z0 K7 E B" [
) p z8 E6 x9 ?<?php
5 w- d5 q4 | W: bbreak;
. j" ^' @! S6 Q/ P5 ncase 'close':7 D5 u8 c, H. A8 o
?>
) L( r5 D8 [/ l) A+ f
$ f8 c7 ?! r; N3 e: f1 S! O5 H<div class="clearfix"></div>7 g( G C# ~9 o, c. e0 t; l* X/ q5 [4 k
</div><!-- OPTION SAVE END -->
7 S- |; _) G7 r2 Y
) B% F2 d2 @7 G0 x<div class="clearfix"></div> I% V& o; ]$ ^: ^# t* v
</div><!-- GET OPTION END -->2 h! G% f3 Y4 L2 l: G# j
* A( n' \2 {2 n! I! f6 r7 j<?php( C4 L4 ?1 h) x) T& t
break;* G$ S) Z' F: R+ [5 b+ e# `
default;3 J: ^+ j4 q8 K k8 m0 { `
?>4 D0 r- T% z1 Z) r5 R e- E( I) N
3 P7 `6 _/ x. K. Y3 k
7 P% h: p' t2 H( ?0 Y* \" v<?php
% t! Y2 _! l% z9 G, Pbreak; } ?>! f2 \% L- x3 u& q
& v3 A& g" H6 ^0 l! p9 a8 C<?php } ?>
) d; a% l6 \, V$ j* Z n( ~3 Z/ I, d1 T; M
<p class="save-p">3 |6 E' z& J2 _1 |: M/ T, |- M5 F
<input name="save" type="submit" class="sbutton" value="Save Options" />3 P( Q' P3 a8 T: v4 s. T
<input type="hidden" name="action" value="save" />
+ t! E" k8 ~3 V! k% `- I2 A</p>& J- U) b$ h; E( X
</form>. J) L. ?! W6 t2 |5 ~
! U4 V9 D |$ H& a/ }$ V<form method="post">
8 o4 z4 f' o1 ~- X( v( V<p class="save-p">
" F+ o% F+ F2 r, f<input name="reset" type="submit" class="sbutton" value="Reset Options" />
+ Y- ~* E+ P" q2 [" ~) T5 K<input type="hidden" name="action" value="reset" />
. P) k3 @; O6 d5 v( b. i6 u</p>
' f. t& M; k2 D</form>
6 K) m: Z% Z7 v( t4 u4 c, d2 L! l" S, [9 V2 X1 X% w
</div><!-- ADMIN OPTIONS END -->3 K9 P$ N) G2 @+ y% V6 ?
) d( t) U8 P0 v! {9 I! z3 I- \<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
. H& c+ s- f: k$ Q# T
: H0 z2 e$ ] vfunction mytheme_admin_register() {2 `) E8 e$ C) ]$ o
global $themename, $shortname, $options;
6 v0 ~7 L8 g" x& i1 P/ Z+ Oif ( $_GET['page'] == basename(__FILE__) ) {
( t* E5 \0 b) [8 j+ yif ( 'save' == $_REQUEST['action'] ) {% G9 f. H# b, r- p7 c
foreach ($options as $value) {
5 k5 n$ W" i6 _update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
; s/ H1 x3 _& Cforeach ($options as $value) {
9 B/ |6 Z; K y) Q e+ g& Lif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }7 [# @5 I: @$ I9 h
header("Location: themes.php?page=functions.php&saved=true");
: x$ i- B; V) r" t" e, G% Gdie;
9 y p- `( F+ ?} else if( 'reset' == $_REQUEST['action'] ) {
0 D* k- s2 c6 j+ o8 _6 Gforeach ($options as $value) {
. s7 d/ H, G6 ?8 bdelete_option( $value['id'] ); }
6 C3 P, o4 { t9 P9 Y( Aheader("Location: themes.php?page=functions.php&reset=true");4 U" b4 d' t i5 K$ ~# X! x0 o
die;
2 Y- s& e8 F+ w R+ _1 h}
9 Q! _5 y7 O2 I4 T0 p}
1 Y. {& r# x; X2 i$ H( D0 hadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');; O( [- A' r5 p; ], o3 Z
}
& d) E0 g( e5 V& W( P0 S2 U7 G$ [" o* x$ W
function mytheme_admin_head() { ?>
& K/ l# S) f: Z: e' G. h<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />: [! ]$ e/ w0 H, X4 W" M$ d; W2 C
<?php }
. l2 u5 M3 |. a |
|