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