|
|

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