|
|

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