|
|

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