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