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