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