|
|

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