|
|

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