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