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