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