|
|

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